Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hz8Re-0005CQ-Aa for pgsql-general@arkaria.postgresql.org; Sat, 17 Aug 2019 23:49:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hz8Rc-0008Qi-P5 for pgsql-general@arkaria.postgresql.org; Sat, 17 Aug 2019 23:49:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hz8Rc-0008OF-Aw for pgsql-general@lists.postgresql.org; Sat, 17 Aug 2019 23:49:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hz8RZ-0000Xp-Sl for pgsql-general@postgresql.org; Sat, 17 Aug 2019 23:49:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7HNn6uK025629; Sat, 17 Aug 2019 19:49:06 -0400 From: Tom Lane To: stan cc: pgsql-general@postgresql.org Subject: Re: How to determine what is preventing deleting a rule In-reply-to: <20190817233725.GA11582@panix.com> References: <20190817233725.GA11582@panix.com> Comments: In-reply-to stan message dated "Sat, 17 Aug 2019 19:37:25 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25627.1566085746.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 17 Aug 2019 19:49:06 -0400 Message-ID: <25628.1566085746@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk stan writes: > I have deleted, what i thought were all the objects referenced by these= roles, > but I still get an error saying there is one object they reference. > How can I find out what this object is? The error should tell you, if you're connected to the database where that object is. regression=3D# create database d1; CREATE DATABASE regression=3D# create database d2; CREATE DATABASE regression=3D# create user joe; CREATE ROLE regression=3D# \c d2 joe You are now connected to database "d2" as user "joe". d2=3D> create table tt(d1 int); CREATE TABLE d2=3D> \c d1 postgres You are now connected to database "d1" as user "postgres". d1=3D# drop user joe; ERROR: role "joe" cannot be dropped because some objects depend on it DETAIL: 1 object in database d2 d1=3D# \c d2 You are now connected to database "d2" as user "postgres". d2=3D# drop user joe; ERROR: role "joe" cannot be dropped because some objects depend on it DETAIL: owner of table tt Unfortunately, we can't see into the catalogs of a different database to explain about dependencies there ... regards, tom lane