pgsql: Include check on polpermissive relcache for policies

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Include check on polpermissive relcache for policies
Date: 2026-07-15 01:04:16
Message-ID: E1wjo2p-000DeO-2j@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Reviewed-by: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Discussion: https://postgr.es/m/CAMxA3rv1CS6R7JR5ojz-3CmCEnZEFrqu+XXTnGbLRWrjJRH7sA@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2d1ed2c1dd8e8eb4daa300f574331864a6c49688

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

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-07-15 01:53:54 pgsql: Rework pgstat_write_statsfile() in combination with to_serialize
Previous Message Richard Guo 2026-07-15 00:23:38 pgsql: Strip removed-relation references from PHVs in join clauses