Re: LIST OWNED BY...

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: LIST OWNED BY...
Дата
Msg-id 1330550340-sup-1278@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: LIST OWNED BY...  (Thom Brown <thom@linux.com>)
Список pgsql-hackers
Excerpts from Thom Brown's message of mié feb 29 17:50:14 -0300 2012:
> On 29 February 2012 20:33, Euler Taveira de Oliveira <euler@timbira.com> wrote:
> > On 29-02-2012 15:23, Thom Brown wrote:
> >> Or just change it to output a verbose notice without changing the syntax?
> >>
> > I can't see why we will do it only for DROP OWNED. Chat messages are annoying
> > unless the user asks for it (that's why I suggested VERBOSE).
>
> Possibly, but I think if you're going ahead an dropping objects owned
> by a role, you'll tend to be interested in what those things were
> rather than blindly removing things from the database without actually
> knowing what they are.

Sure.

Initially DROP OWNED was supposed to be used only after REASSIGN OWNED.
So you give your objects to someone else, then DROP OWNED to revoke
whatever privileges you have (which is the only thing that REASSIGN
OWNED wouldn't have touched), then commit suicide.  There is no danger
of dropping useful objects in this scenario because you already gave
them away.  (Unless, of course, some other poor soul is busy reassigning
objects to you).

I agree that it might be useful to list objects owned by a given user.
Maybe this belongs into a view or a function, however, not a new
command.  After all, the mechanism that those commands use to display
objects is not very user-friendly, or even claims to be complete (the
lists are truncated after 200 objects or something like that).

More generally, maybe the thing to do is have a SRF that reports objects
that depend on some other object.  If you specify a role as the
referenced object, you get what's this thread is about.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: COPY with hints, rebirth
Следующее
От: Robert Haas
Дата:
Сообщение: Re: 16-bit page checksums for 9.2