pgsql: Include check on polpermissive relcache for policies

Started by Michael Paquier4 months ago1 messagescommitters
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Include check on polpermissive relcache for policies

equalPolicy() is used in the relation cache to check if two policy
definitions are equivalent, but missed to check for polpermissive.

ALTER POLICY cannot switch a policy to be PERMISSIVE or RESTRICTIVE, so
this would need a dropped and then re-created policy, which would
trigger a relcache invalidation. Anyway, there is no harm in being
consistent in the check, and if one decides to add an ALTER POLICY to
switch PERMISSIVE or RESTRICTIVE, we would be silently in trouble.

Author: Andreas Lind <andreaslindpetersen@gmail.com>
Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>
Discussion: /messages/by-id/CAMxA3rv1CS6R7JR5ojz-3CmCEnZEFrqu+XXTnGbLRWrjJRH7sA@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/36c6b499761878d40fd5f62b698546374a8aa5bc

Modified Files
--------------
src/backend/utils/cache/relcache.c | 2 ++
1 file changed, 2 insertions(+)