Global-state planning must handle a planned SET membership for the schema owner
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:
- Create
app_ownerand make it owner of the managed schema. - Connect as
deployerwithout SET authority onapp_owner. - Declare
GRANT app_owner TO deployerwith the version-appropriate SET capability in global desired state. - 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.
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.