Re: Dependencies on shared objects

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)surnet(dot)cl>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Dependencies on shared objects
Date: 2005-07-07 16:43:26
Message-ID: 20050707164326.GC9336@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Tue, Jul 05, 2005 at 03:51:32PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> > On Tue, Jul 05, 2005 at 02:47:15PM -0400, Tom Lane wrote:
> >> Although I don't have any particular objection to the OWNER/NORMAL
> >> distinction, your explanation doesn't seem to make sense. Don't you
> >> have to poke the Acl anyway, if it's non-null? Else the grantor values
> >> will be wrong.
>
> > Hum, we don't register a dependency on the owner when registering
> > dependencies from the Acl -- we actively skip that (because we know the
> > owner has an entry of the other type already). Is this still an issue?
>
> Not sure. ISTM the distinction we want to capture is more along the
> lines of DEPENDENCY_NORMAL vs DEPENDENCY_AUTO --- that is, we should be
> willing to auto-drop grants to a user when dropping the user, but not be
> willing to auto-drop objects unless the drop is with CASCADE. Also,
> grants from the user to someone else (using grant options) probably
> shouldn't go away without CASCADE either, though this is maybe
> debatable. If you believe the latter then the OWNER/ACL division is
> clearly the wrong way to think about it. So I'd be inclined to use
> the NORMAL/AUTO terminology instead.

I'm not sure about DROP USER CASCADE. There's an inherent asymmetry in
that command, because as soon as the user has dependencies in some other
database, you cannot do anything, and the cascade will fail. So I'd
rather not offer a DROP USER CASCADE, but just reject the command when
there are any dependencies, and provide a command to drop the owned
objects (DROP OWNED), or to give them to someone else (REASSIGN OWNED --
better wording?).

An important distinction to be made is which dependencies are "auto" and
which ones are "normal". It's clear that OWNER entries cannot be AUTO.
OTOH grantee entries in the ACL can be (have to be) dropped
automatically, but what to do about grantor ones? We may have to do a
distinction. We could drop the grants for which the dropped user is the
grantor; but not automatically, I think.

--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Postgres is bloatware by design: it was built to house
PhD theses." (Joey Hellerstein, SIGMOD annual conference 2002)

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2005-07-07 16:54:28 Re: A couple of patches for PostgreSQL 64bit support
Previous Message Tom Lane 2005-07-07 16:35:36 Re: A couple of patches for PostgreSQL 64bit support