Proper object locking for GRANT/REVOKE
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-10-28T15:20:42Z
Lists: pgsql-hackers
Attachments
- 0001-Proper-object-locking-for-GRANT-REVOKE.patch (text/plain) patch 0001
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.
Commits
-
Put back intra-grant-inplace.spec test coverage
- 310d04169a41 19 (unreleased) landed
- baf45ba0533f 18.0 landed
-
Improve objectNamesToOids() comment
- e36fa9319b13 19 (unreleased) landed
- 118601a7e8c0 18.0 landed
-
Proper object locking for GRANT/REVOKE
- d31bbfb6590e 18.0 landed
-
Add an assertion in get_object_address()
- e468ec0fddcd 18.0 landed