Re: Can't delete role because of unknown object

From: Craig Libscomb <craiglibscomb1972(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can't delete role because of unknown object
Date: 2014-04-22 21:05:22
Message-ID: CAABzkTjTGa0JVBm1ANKafy_QqWUh=gMRarf9wbdombYAhbo2pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 22, 2014 at 3:39 PM, Igor Neyman <ineyman(at)perceptron(dot)com> wrote:
>
>
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:
pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Craig Libscomb
> Sent: Tuesday, April 22, 2014 4:27 PM
> To: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Can't delete role because of unknown object
>
> On Tue, Apr 22, 2014 at 3:06 PM, Raymond O'Donnell <rod(at)iol(dot)ie> wrote:
> On 22/04/2014 20:47, Craig Libscomb wrote:
>> The following command:
>> DROP USER IF EXISTS jpate;
>>
>> generates the following output:
>> ERROR: role "jpate" cannot be dropped because some objects depend on it
>> DETAIL: 1 object in database products
>>
>> It would be most helpful to know what object in the products database
>> depends on the jpate role, but I am unable to find anything that even
>> begins to offer a clue. What command will show me this mysterious
>> object, please?
> I'd hazard a guess that there is another role which is a member of this
> one.... connect to the database using psql, and then \du will give you a
> list of all roles - in the output from \du, look at the column "Member
of".
>
> All of the roles have {} under "member of", so I assume that means no
members?
>
>
> HTH,
>
> Ray.
>
>
> You could try:
>
> SELECT C.relname, C.reltype
> FROM pg_class C, pg_authid O
> WHERE O.rolname = 'jpate'
> AND C.relowner = O.oid;

Dummy me, I was connected to the wrong database.

This returned 0 rows though. Even tried it with a different user. But
punching in postgres gave me lots of info. Thanks for the hint.

>
> Regards,
> Igor Neyman
>

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2014-04-22 22:24:46 aggregate returning anyarray and 'cannot determine result data type'
Previous Message Craig Libscomb 2014-04-22 21:01:28 Re: [SOLVED] Can't delete role because of unknown object