schemadiff: describability refusals — partitions, FKs, unlogged, collations, sequence ownership - #55
Merged
Merged
Conversation
Kiran01bm
marked this pull request as ready for review
August 20, 2026 09:59
Kiran01bm
requested review from
JashLal,
aparajon,
eeSeeGee,
jayjanssen,
jemiahw and
morgo
as code owners
August 20, 2026 09:59
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Kiran01bm
marked this pull request as draft
August 20, 2026 10:00
Kiran01bm
force-pushed
the
kiran01bm/ws8-fk-partition-refusal
branch
from
August 20, 2026 19:42
5f0aef5 to
9b5a2d1
Compare
The single-table model carries no partition topology and no incoming foreign-key relationships, so a rendered baseline of either would look complete while being silently wrong. Fail closed with typed errors instead, and document the declarative-model boundaries (FKs in either direction, partitioned tables, non-table objects) in limitations.md and the README so the v1 capability surface is explicit.
A foreign key on a partitioned referencing table is mirrored onto every partition in pg_constraint; without the conislocal filter (already used by introspectConstraints) ReferencedBy reported one entry per partition clone, and a partitioned self-referential FK leaked its clones past the self-reference exclusion. Tests pin both cases; ErrUnsupportedChange's doc comment now covers its partition-difference call sites.
…enders Address the #52 adversarial review: Render's two proofs (ParseDesired admissibility, diff-to-zero) are structurally blind to omission, so the facts the model cannot carry now refuse instead of silently vanishing from the baseline. serialType requires a genuine pg_depend OWNED BY edge (Column.SequenceOwned), not the serial-style sequence name; unlogged tables and explicit column collations refuse on both render and diff with their own typed sentinels; a zero-column table renders (). Also excludes partition clones from ReferencedBy (conislocal), matching introspectConstraints. Amp-Thread-ID: https://ampcode.com/threads/T-01a01341-1d4b-7198-a602-a7ea4b7c4884 Co-authored-by: Amp <amp@ampcode.com>
Kiran01bm
force-pushed
the
kiran01bm/ws8-fk-partition-refusal
branch
from
August 20, 2026 23:50
9b5a2d1 to
5e62e46
Compare
Kiran01bm
marked this pull request as ready for review
August 20, 2026 23:50
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
JashLal
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #52: the render/export path now fails closed on the two shapes the single-table model cannot represent — partitioned tables and tables involved in foreign-key relationships in either direction — and the repo gains an explicit public capability statement.
What
Introspectcaptures partition identity (relispartition,pg_get_partkeydef) and incoming foreign keys (ReferencedBy, self-referential FKs excluded) on the model.Renderrefuses a partitioned parent/partition and a table other tables reference, each with its own typed error; a table carrying outgoing FKs already surfaces the parse gate's typed error.Difftreats partitioning as table identity: a partition-key or attachment mismatch between live and desired is a typedErrUnsupportedChange, never a silent zero diff.docs/limitations.mdgains a "Declarative model boundaries" table (FKs both directions, partitioned tables, non-table objects, one table per file); README gains a "What pg-sprite does not do yet" section;AGENTS.mdinstructs that every capability-changing PR and every release sweep updates both.Why
A rendered baseline of a partitioned table or an FK-involved table would look complete while being silently wrong — the model carries no partition bounds and no incoming-FK topology, so an exported file would drop them without a trace. Refusing with a typed error keeps the WS-8/WS-9 baseline-onboarding path trustworthy, and the capability docs make the v1 boundary explicit before users point the tool at a database.
Before / after