From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Proper object locking for GRANT/REVOKE |
Date: | 2024-10-28 15:20:42 |
Message-ID: | bf72b82c-124d-4efa-a484-bb928e9494e4@eisentraut.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
This patch started out as a refactoring, thinking that
objectNamesToOids() in aclchk.c should really mostly be a loop around
get_object_address(). This is mostly true, with a few special cases
because the node representations are a bit different in some cases, and
OBJECT_PARAMETER_ACL, which is obviously very different. This saves a
bunch of duplicative code, which is nice.
Additionally, get_object_address() handles locking, which
objectNamesToOids() somewhat famously does not do, and there is a code
comment about it. With this refactoring, we get the locking pretty much
for free.
Interestingly, this changes the output of the intra-grant-inplace
isolation test, which is recent work. It might be good to get some
review from those who worked on that, to make sure that the new behavior
is still correct and/or to check whether those test cases are still
applicable.
Also, it would be worth thinking about what the correct lock mode should
be here.
Attachment | Content-Type | Size |
---|---|---|
0001-Proper-object-locking-for-GRANT-REVOKE.patch | text/plain | 7.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | cca5507 | 2024-10-28 15:21:39 | Reduce one comparison in binaryheap's sift down |
Previous Message | Tom Lane | 2024-10-28 15:16:54 | Re: Alias of VALUES RTE in explain plan |