pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Wojciechowski, Robert (GE Transportation) <wojo@ge.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: How was I able to drop a role even though objects depend on it?
Date: Mon, 1 Jul 2013 12:20:21 -0400
Message-ID: <20130701162021.GE3757@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <59BF48FAC524384DA413D8F4F2E4BA6907D9A9DA@CINURCNA06.e2k.ad.ge.com>
References: <59BF48FAC524384DA413D8F4F2E4BA6907D9A9DA@CINURCNA06.e2k.ad.ge.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Wojciechowski, Robert (GE Transportation) wrote:
> I’ve noticed a weird situation on one of our development servers running PostgreSQL 9.1.3 where roles have been dropped even though objects depend on that user. I didn’t think that was possible due to the dependency checks on DROP USER/ROLE. For example, there is a database that shows this connect grant to a user that was known as foo1_userA (oid 3562339547): 3562339547=c/postgres This happened after a nightly database import script was run that takes in new clone databases from production. After the script imports new databases another script runs that drop all users matching a regex (/^foo1_user/ for example) to clear out stale users. This obviously should succeed dropping a user that does not have dependent objects and should fail on users that do. For some this is not holding true. Is this a bug? Am I relying too much on DROP USER/ROLE? Any alternative approaches to clearing out users that do not have dependent objects or guidance on debugging this situation would be much appreciated! -- Robert

It sounds like a bug to me.  Can you provide a self-contained reproducer
of this?  It'd be useful to know what kind of objects (should have)
depended on that user, for instance.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (5+ messages)  latest in thread

Message-ID: <20130701162021.GE3757@eldon.alvh.no-ip.org>
Permalink:  ../20130701162021.GE3757@eldon.alvh.no-ip.org/
Also on:    postgresql.org/message-id/20130701162021.GE3757@eldon.alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: alvherre@2ndquadrant.com, wojo@ge.com
  Subject: Re: How was I able to drop a role even though objects depend on it?
  In-Reply-To: <20130701162021.GE3757@eldon.alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox