pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Reject references to roles declared absent in the same global manifest

Open Goldziher opened this issue 1 month ago • 1 comments

Parent: #627

A role declared state = "absent" remains available to other declarations when it currently exists.

Reproduced with ownership; the same contradiction applies to memberships and default privileges:

  1. Declare app_owner absent.
  2. Declare an object owner or default-privilege owner as app_owner.
  3. Plan against a database where app_owner currently exists.

Observed: planning accepts mutually contradictory work, can transfer/grant to the role, and later tries to drop it. This can fail after earlier groups have committed and cannot represent the requested final state.

Required behavior: manifest validation rejects every membership, ownership, or default-privilege reference to a role declared absent before planning any mutation.

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