Re: Broken lock management in policy.c. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Broken lock management in policy.c.
Date
Msg-id 22458.1451872490@sss.pgh.pa.us
Whole thread Raw
In response to Re: Broken lock management in policy.c.  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> On Sunday, January 3, 2016, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

> Agreed.

On closer inspection, I'd misidentified the functions containing the
bad code --- it was really RemovePolicyById and RemoveRoleFromObjectPolicy
that were wrong.  Fix pushed.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: 9.5 BLOCKER: regrole and regnamespace and quotes
Next
From: Peter Geoghegan
Date:
Subject: Re: Broken lock management in policy.c.