pgsql: Invalidate plan cache after role changes.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Invalidate plan cache after role changes.
Date: 2026-08-10 13:41:23
Message-ID: E1wtQFn-00000000y5a-0b9T@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Invalidate plan cache after role changes.

Role membership, role attribute, and database ownership changes may
impact the expected behavior of row-level security policies, but
currently the plan cache doesn't take notice. To fix, register
syscache callbacks on pg_auth_members, pg_authid, and pg_database
that invalidate the role-dependent plans. Changes to other
databases' pg_database rows are ignored.

Reported-by: Ilya Staroverov <i(dot)staroverov(at)ftdata(dot)ru>
Reported-by: Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>
Author: Ilya Staroverov <i(dot)staroverov(at)ftdata(dot)ru>
Author: Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>
Co-authored-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Security: CVE-2026-14666
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/567286b762bcb7a70233e5bb4b401fc62f9424ee
Author: Nathan Bossart <nathan(at)postgresql(dot)org>

Modified Files
--------------
src/backend/utils/adt/acl.c | 2 +-
src/backend/utils/cache/plancache.c | 61 ++++++++++++++++++++++++++++++++++++-
src/include/utils/acl.h | 3 ++
3 files changed, 64 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2026-08-10 13:41:24 pgsql: pg_dump: avoid assuming how long pg_proc.protrftypes can be.
Previous Message Noah Misch 2026-08-10 13:41:22 pgsql: Use palloc_array() in pltcl and plperl to avoid overflow