Re: referential integrity requires write permission to a table which only needs to be read - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: referential integrity requires write permission to a table which only needs to be read
Date
Msg-id Pine.BSF.4.10.10008300705400.60082-100000@megazone23.bigpanda.com
Whole thread Raw
In response to referential integrity requires write permission to a table which only needs to be read  (pgsql-bugs@postgresql.org)
List pgsql-bugs
On Wed, 30 Aug 2000 pgsql-bugs@postgresql.org wrote:

> Short Description
> referential integrity requires write permission to a table which only needs to be read

Yes, this is a known problem.

> And, why is the trigger trying to select WITH UPDATE? (locking?)
Yes, if you don't grab a row lock, another transaction can come
along and delete the row you're referencing after you've checked
it, but before that transaction sees that you've added a referencing
row (which could lead to orphened children)

> In any case, this is requiring us to grant update permission to this
> user group, and we really only want them to have select permission to
> the table in question.

Right now, the suggested workaround is to do a trigger before updates
that prevents the unwanted writes in plpgsql.  Not particularly good,
but functional until this gets fixed (and I don't know precisely when
that'll be)

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: inconsistent debug log output
Next
From: Tom Lane
Date:
Subject: Re: inconsistent debug log output