Re: Solution for RI permission problem - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Solution for RI permission problem
Date
Msg-id Pine.BSF.4.10.10010011119530.10491-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Solution for RI permission problem  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Solution for RI permission problem  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Wed, 20 Sep 2000, Peter Eisentraut wrote:

> Here's what I've come up with to avoid "permission denied" errors when a
> RI trigger has to lock a PK table.  Whenever the SELECT FOR UPDATE is
> executed I temporarily switch the current user id to the owner of the PK
> table.  It's not the grand unified solution via setuid functions that was
> envisioned now and then, but it does the same conceptually.  For a
> terminally elegant solution I can only suggest not using the SPI
> interface.
> 
> I recommend this patch to be checked out by someone knowledgeable in the
> RI area.

It seems to be working on my system (and you don't need to give any access
to the pk table to the user).

With that, I do have a general question though. Are referential actions
supposed to be limited by the permissions of the user executing the query?
So, if you for example have write access on the pk table, but not to the
fk table, and there is a on cascade delete relationship, should that user
not be able to delete from the pk table?



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: What do I need to be able to compile the source in Win32
Next
From: Peter Eisentraut
Date:
Subject: Re: Unruly rules