Skip to content

docs: engine-role provisioning contract — tiered access for schema changes - #24

Merged
Kiran01bm merged 2 commits into
mainfrom
kiran01bm/engine-role-contract
Aug 11, 2026
Merged

docs: engine-role provisioning contract — tiered access for schema changes#24
Kiran01bm merged 2 commits into
mainfrom
kiran01bm/engine-role-contract

Conversation

@Kiran01bm

Copy link
Copy Markdown
Collaborator

Summary

Documents the provisioning contract for the engine role — the PostgreSQL user pg-sprite connects as — answering precisely what minimum access is needed to run schema changes against tables the engine does not own. Prompted by real integration targets where DDL is owned by application-specific roles (non-standard owners, partitioned tables) rather than the connecting user.

What

  • New docs/engine-role.md: the tiered access contract — Tier 0 connect/resolve, Tier 1 in-place ALTER TABLE via owning-role membership, Tier 2 index builds (additionally schema CREATE), Tier 3 copy-and-swap (SET ROLE-capable membership + replication access for CDC), Tier 4 planner scratch database. Includes the provisioning GRANTs, the PostgreSQL 16 SET/INHERIT membership caveats, and an explicit "must not have" list (no superuser, no rds_superuser, no app login, no ownership transfer).
  • docs/low-level-design.md, docs/schemabot-integration.md, docs/README.md: cross-links so preflight refusals and the SchemaBot adapter point at one authoritative page.

Why

PostgreSQL has no grantable ALTER privilege — ALTER TABLE, CREATE INDEX, and the rename-swap are owner-gated, and the only non-superuser mechanism is owning-role membership. Without a written contract, every new target becomes an ad-hoc credential negotiation and a missing grant surfaces as a mid-change failure instead of a plan-time refusal. Every claim here was verified against a live PostgreSQL 16 server (including the non-obvious one: membership alone suffices for ALTER TABLE but index builds are refused without schema CREATE). Preflight enforcement of these tiers lands separately; this page is the target its typed refusals will point to.

…anges

PostgreSQL DDL is owner-gated with no grantable ALTER privilege, so an
engine running changes against tables it does not own needs owning-role
membership, not the owner's identity. Documents the verified tier model
(membership alone for in-place ALTER; schema CREATE additionally for
index builds; SET ROLE for owner-correct shadow objects; replication
access for CDC), the provisioning grants, and what the role must not
have. Preflight refusals will name the missing GRANT and point here.
@Kiran01bm
Kiran01bm marked this pull request as ready for review August 11, 2026 21:37
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…-contract

* origin/main:
  extend app-breaking rename classification to table renames
  classify column renames as app-breaking, steer to expand/contract
  Add pkg/executor native CREATE INDEX CONCURRENTLY with fail-closed recovery

# Conflicts:
#	docs/README.md
@Kiran01bm
Kiran01bm merged commit 2decab1 into main Aug 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants