Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Utgmm-0004iV-JK for pgsql-admin@arkaria.postgresql.org; Mon, 01 Jul 2013 16:17:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Utgml-0004D2-DW for pgsql-admin@arkaria.postgresql.org; Mon, 01 Jul 2013 16:17:03 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Utexn-0005go-9E for pgsql-admin@postgresql.org; Mon, 01 Jul 2013 14:20:19 +0000 Received: from exprod5og117.obsmtp.com ([64.18.0.149]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Utexg-00015P-Gt for pgsql-admin@postgresql.org; Mon, 01 Jul 2013 14:20:17 +0000 Received: from cinmlip12.e2k.ad.ge.com ([12.71.149.1]) (using TLSv1) by exprod5ob117.postini.com ([64.18.4.12]) with SMTP ID DSNKUdGQG/a75gr5BIj89CQTu9IL0OUgOZsb@postini.com; Mon, 01 Jul 2013 07:20:12 PDT Received: from unknown (HELO cinmlef12.e2k.ad.ge.com) ([3.159.213.59]) by cinmlip12.e2k.ad.ge.com with ESMTP; 01 Jul 2013 10:20:10 -0400 Received: from alpmlef03.e2k.ad.ge.com ([3.159.18.12]) by cinmlef12.e2k.ad.ge.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 1 Jul 2013 10:20:10 -0400 Received: from cinmlch01.e2k.ad.ge.com ([3.159.212.50]) by alpmlef03.e2k.ad.ge.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 1 Jul 2013 10:20:09 -0400 Received: from CINURAPD07.e2k.ad.ge.com (3.159.212.119) by cinmlch01.e2k.ad.ge.com (3.159.212.50) with Microsoft SMTP Server (TLS) id 14.3.136.1; Mon, 1 Jul 2013 10:20:04 -0400 Received: from CINURCNA06.e2k.ad.ge.com ([169.254.6.130]) by CINURAPD07.e2k.ad.ge.com ([169.254.9.14]) with mapi id 14.03.0136.001; Mon, 1 Jul 2013 10:20:04 -0400 From: "Wojciechowski, Robert (GE Transportation)" To: "pgsql-admin@postgresql.org" Subject: How was I able to drop a role even though objects depend on it? Thread-Topic: How was I able to drop a role even though objects depend on it? Thread-Index: Ac52XqQF0hHK63TvQ3CymSYhVpQZbQ== Date: Mon, 1 Jul 2013 14:20:03 +0000 Message-ID: <59BF48FAC524384DA413D8F4F2E4BA6907D9A9DA@CINURCNA06.e2k.ad.ge.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.5.130515 x-originating-ip: [3.159.212.182] Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 01 Jul 2013 14:20:09.0333 (UTC) FILETIME=[17800250:01CE7666] X-Pg-Spam-Score: -1.5 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org I=92ve noticed a weird situation on one of our development servers running = PostgreSQL 9.1.3 where roles have been dropped even though objects depend o= n that user. I didn=92t think that was possible due to the dependency check= s on DROP USER/ROLE. For example, there is a database that shows this conne= ct grant to a user that was known as foo1_userA (oid 3562339547): 356233954= 7=3Dc/postgres This happened after a nightly database import script was run= that takes in new clone databases from production. After the script import= s new databases another script runs that drop all users matching a regex (/= ^foo1_user/ for example) to clear out stale users. This obviously should su= cceed 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 re= lying too much on DROP USER/ROLE? Any alternative approaches to clearing ou= t users that do not have dependent objects or guidance on debugging this si= tuation would be much appreciated! -- Robert --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin