Re: dropping role w/dependent objects

Поиск
Список
Период
Сортировка
От Martin Gainty
Тема Re: dropping role w/dependent objects
Дата
Msg-id BAY133-DAV4223A6A8E286AA4FC94F0AE660@phx.gbl
обсуждение исходный текст
Ответ на dropping role w/dependent objects  ("Ed L." <pgsql@bluepolka.net>)
Список pgsql-general
Ed--

check out REASSIGN OWNED
http://www.postgresql.org/docs/current/static/sql-reassign-owned.html

then use CASCADE option of DROP OWNED to drop dependents
e.g.
DROP OWNED BY FUBAR CASCADE
http://www.postgresql.org/docs/current/static/sql-drop-owned.html

HTH,
Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message -----
From: "Ed L." <pgsql@bluepolka.net>
To: "Alvaro Herrera" <alvherre@commandprompt.com>
Cc: <pgsql-general@postgresql.org>
Sent: Wednesday, April 04, 2007 6:41 PM
Subject: Re: [GENERAL] dropping role w/dependent objects


> On Wednesday April 4 2007 4:39 pm, Ed L. wrote:
>> On Wednesday April 4 2007 4:35 pm, Alvaro Herrera wrote:
>> > Note that you can give the objects owned by that role to
>> > someone else with REASSIGN OWNED, and drop the objects with
>> > DROP OWNED (note that they act differently regarding grants;
>> > see the docs)
>>
>> Yes, but how do identify what they are so that I know if I
>> want to DROP OWNED them?
>
> The REASSIGN OWNED appears to be insufficient:
>
> % psql -c "reassign owned by mygroup to mydba"
> REASSIGN OWNED
> % psql -c "drop group mygroup"
> ERROR:  role "mygroup" cannot be dropped because some objects
> depend on it
> DETAIL:  225 objects in this database
>
> Thanks,
> Ed
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: dropping role w/dependent objects
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: newid() in postgres