Broken lock management in policy.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Broken lock management in policy.c.
Date: 2016-01-04 00:32:23
Message-ID: 10620.1451867543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

CREATE POLICY takes AccessExclusiveLock on the table a policy is being
added to -- good -- and then releases it when done -- bad. Correct
behavior is to hold the lock till commit, because otherwise there is
no guarantee that other backends will see the updated catalog rows in
time, or indeed at all.

The same goes for ALTER POLICY, and possibly DROP POLICY (I've not
found the implementation of that ...)

If we fix this, I believe we could also remove the weasel wording that was
added to create_policy.sgml in commit 43cd468cf01007f3 about how the
system might transiently fail to enforce row security correctly.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-01-04 00:46:01 row_security GUC does not behave as documented
Previous Message David Fetter 2016-01-04 00:09:26 Re: Improved tab completion for FDW DDL