Re: Eror while dropping a user

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ertan Küçükoğlu <ertan(dot)kucukoglu(at)1nar(dot)com(dot)tr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Eror while dropping a user
Date: 2018-08-03 22:22:56
Message-ID: 7210.1533334976@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= <ertan(dot)kucukoglu(at)1nar(dot)com(dot)tr> writes:
> Using PostgreSQL 9.6.9 on Linux amd64 platform.

> 2018-08-03 23:24:03.901 Drop user failed: SQL Error: ERROR: role
> "pars.test" cannot be dropped because some objects depend on it
> AYRINTI: 1 object in database postgres

I see you've resolved your problem, but for future reference, note that
you could have gotten a more detailed error message if you'd issued the
DROP USER while connected to the postgres database. When the command
is issued in database A, we can't see the details of what the user owns
in database B, only that there is something over there :-(

FWIW, I'm guessing that the issue was not object ownership per se,
but permissions granted on some object owned by someone else. Those
have to be revoked as well before a DROP USER will succeed.

You might also care to read up on DROP OWNED BY.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2018-08-04 06:44:59 Re: Pg_rewind cannot load history wal
Previous Message Ertan Küçükoğlu 2018-08-03 21:46:26 RE: Eror while dropping a user