Re: Permission denied when inserting - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Permission denied when inserting
Date
Msg-id 201102280920.47191.adrian.klaver@gmail.com
Whole thread Raw
In response to Re: Permission denied when inserting  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Monday, February 28, 2011 9:15:27 am Tom Lane wrote:
> Adrian Klaver <adrian.klaver@gmail.com> writes:
> > I understand, yet I don't:) Seems I have a misconception of the the
> > FOREIGN KEY process. The error was on the query below, which I am
> > taking is the query you refer to above. To me it looks like a look up
> > from the referencing(permout) table to the referenced(out2cp) one. The
> > part I am not clear on is why that runs with the permissions of the
> > referenced table not the referencing table?
>
> Because we force it that way so that you don't have to splatter
> permissions all around to support a foreign key check.  Generally
> the internal FK check queries will only fail if the owner of a table
> revokes his own permissions, which isn't too usual.
>
>             regards, tom lane

Had not thought about it from that angle. Thanks.

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Permission denied when inserting
Next
From: Alan Acosta
Date:
Subject: Lock ACCESS EXCLUSIVE and Select question !