Re: ExecutorCheckPerms() hook - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: ExecutorCheckPerms() hook
Date
Msg-id 20100722011507.GJ21875@tamriel.snowman.net
Whole thread Raw
In response to Re: ExecutorCheckPerms() hook  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
* Robert Haas (robertmhaas@gmail.com) wrote:
> On Wed, Jul 21, 2010 at 9:02 PM, Stephen Frost <sfrost@snowman.net> wrote:
> > Errr, no.  If I grant you REFERENCES on my table, it means you can
> > create a FK to it from some other table.
>
> Well, in that case, we should fix the fine documentation:
>
>        To create a foreign key constraint, it is
>        necessary to have this privilege on both the referencing and
>        referenced columns.  The privilege may be granted for all columns
>        of a table, or just specific columns.

Technically that's true..  You just *also* have to own the referencing
table. :)  I agree though, if my claims are correct (which I'd like to
think they are, but perusing the SQL spec just now didn't make it as
abundently clear as I would have hoped...), and it's how PG acts today
anyway, we should definitely fix the docs.

Also, we do document that to use ALTER TABLE you have to own the table
you're calling ALTER TABLE on, and obviously if you're calling CREATE
TABLE you're "owner" of the object..  Have we got another way to add a
FK to an existing table?  If so, we should make sure they're all
consistant in any case.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: ExecutorCheckPerms() hook
Next
From: KaiGai Kohei
Date:
Subject: Re: ExecutorCheckPerms() hook