From: | Stephen Frost <sfrost(at)snowman(dot)net> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: ExecutorCheckPerms() hook |
Date: | 2010-07-22 01:15:07 |
Message-ID: | 20100722011507.GJ21875@tamriel.snowman.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
* Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
> On Wed, Jul 21, 2010 at 9:02 PM, Stephen Frost <sfrost(at)snowman(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | KaiGai Kohei | 2010-07-22 01:18:50 | Re: ExecutorCheckPerms() hook |
Previous Message | Robert Haas | 2010-07-22 01:08:23 | Re: ExecutorCheckPerms() hook |