pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Global-state planning must handle a planned SET membership for the schema owner

Open Goldziher opened this issue 1 month ago • 1 comments

Parent: #627

A valid non-superuser repair becomes unplannable when the declared schema owner already exists but the deployment role's SET-enabled membership is absent and is itself part of the desired change.

Reproduced on PostgreSQL 15, 16, 17, and 18:

  1. Create app_owner and make it owner of the managed schema.
  2. Connect as deployer without SET authority on app_owner.
  3. Declare GRANT app_owner TO deployer with the version-appropriate SET capability in global desired state.
  4. Plan the schema and global state together.

Observed: planning aborts with session role cannot SET ROLE to schema owner "app_owner" for inspection before it can emit the membership repair.

Required behavior: planning remains read-only and can safely inspect the managed schema, emit the membership repair, apply it, and reach a zero-step replan. It must not temporarily grant authority during planning.

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