Re: LIST OWNED BY...

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: LIST OWNED BY...
Date: 2012-02-29 21:24:09
Message-ID: 1330550340-sup-1278@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)timbira(dot)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(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-02-29 21:24:27 Re: 16-bit page checksums for 9.2
Previous Message Simon Riggs 2012-02-29 21:19:17 Re: COPY with hints, rebirth