Re: bad message or bad privilege check in foreign key constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: depesz(at)depesz(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org, Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Subject: Re: bad message or bad privilege check in foreign key constraint
Date: 2008-01-22 17:56:14
Message-ID: 4211.1201024574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

hubert depesz lubaczewski <depesz(at)depesz(dot)com> writes:
> apparently revoking update rights on referencing table blocks deletes on master table:

>> revoke update on b from test;
> REVOKE

>> delete from a where id = 1;
> ERROR: permission denied for relation b
> CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."b" x WHERE $1 OPERATOR(pg_catalog.=) "a_id" FOR SHARE OF x"

Hmm. I wonder why we are bothering with FOR SHARE locks on the
referencing table, when we don't have any intention to change
those rows. Is there some race condition that's needed to prevent?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Adam Hardy 2008-01-22 23:42:17 BUG #3894: JDBC DatabaseMetaData.getTables is inconsistently case-sensitive with schema name
Previous Message Tom Lane 2008-01-22 17:42:58 Re: why provide cross type arithmetic operators