pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

PostgreSQL 16 multi-grantor memberships need deterministic reconciliation

Open Goldziher opened this issue 1 month ago • 1 comments

Parent: #627

PostgreSQL 16 and newer can retain separate membership rows/options by grantor. Collapsing those rows with bool_or loses the grantor that supplies an option.

Reproduced on PostgreSQL 16, 17, and 18:

  1. Two grantors grant the same role membership.
  2. One row supplies an option such as ADMIN, INHERIT, or SET.
  3. Desired state requires that option to be false.
  4. Plan and apply through a grantor that cannot remove the competing row.

Observed: inspection reports one merged membership, planning accepts the change, and a single GRANT/REVOKE cannot converge the other grantor's option. Replanning remains non-zero.

Required behavior: inspect grantor rows and either reconcile every authoritative row or reject competing grants deterministically before mutation. PostgreSQL 15 is unaffected because these per-grant option rows are a 16+ behavior.

Goldziher avatar Oct 09 '26 09:10 Goldziher

Tracked under #627. A proposed implementation is in #637, which is still under discussion. Closing this sub-issue since it is covered by the #627 umbrella.

tianzhou avatar Oct 15 '26 03:10 tianzhou