A patch release carrying the two library additions that landed just after the v0.3.0 cut, giving orchestrators two typed signals around the create path: a closed vocabulary for why a desired statement's shape was refused, and a catalog read of the constraint-index and sequence names a table actually ended up owning. No format_version, outcome-code or refusal-reason vocabulary changes; the CLI's behaviour is unchanged.
Highlights
Create-shape refusals carry a typed cause
executor.CreateShapeCause— the create path's shape refusals (PARTITION OF,INHERITS,LIKE,OF type,IF NOT EXISTS,CONCURRENTLYon a table born this run, a duplicate relation name, a multi-operation statement, an unsupported kind) now carry one of nine flat kebab-case causes instead of only prose, so a consumer branches on the cause the way it branches on outcome codes.CreateShapeCauses()enumerates the closed set;Description()is the single owner of each human sentence;*CreateShapeError{Cause, Name}unwraps to the sentinel the cause belongs to, so existingerrors.Iscallers and theOutcomeCodemapping are untouched;CreateShapeCauseOf(err)reads the cause through wrappers, including aSequenceStepError. A cause added without aDescription()orUnwrap()arm fails the suite rather than rendering "unknown create-shape refusal" at runtime. (#82)
Read back what a table owns
preflight.LookupOwnedRelationNames(ctx, pool, schema, table)— one catalog read returning the constraint-index names (pg_constraint, contypep/u/x; a foreign key's borrowed index on the referenced table is excluded) and column-owned sequence names (pg_dependdeptypea/i, relkindS) a table owns, sorted and duplicate-free, whether the server invented the name or the desired file stated it. PostgreSQL never raises42P07/42710for an implicit name taken inside the absence proof's time-of-check window — it silently suffixes (t_pkey1,t_id_seq1) — and this read is what lets a caller detect that after theCREATE TABLEstep. Schema is required; a missing relation isErrTableNotFound, a non-table at the name isErrNotTable. The create path does not yet run the comparison itself. (#83)
Upgrade notes
- Library API additions, no removals. New in
executor:CreateShapeCauseand its nine constants,CreateShapeCauses(),CreateShapeCause.Description(),*CreateShapeError(Unwrap()returns the existing sentinel),CreateShapeCauseOf(err). New inpreflight:OwnedRelationNames{ConstraintIndexes, Sequences},LookupOwnedRelationNames,ErrTableNotFound,ErrNotTable. No signature changed. - Six create-shape sentences lost their prefix. The
INHERITS,LIKE,OF,CONCURRENTLY, multiple-operations and unsupported-kind refusals no longer start withstatement is not a shape the create path can run:; every renderer already says the create path refuses the statement.PARTITION OF,IF NOT EXISTSand duplicate-name text is byte-identical. A consumer matching refusal text should switch toCreateShapeCauseOf;errors.IsagainstErrUnsupportedCreateStep,ErrPartitionOfUnsupported,ErrIfNotExistsUnsupportedandErrDuplicateCreateNamekeeps working. - No
format_version, outcome-code or refusal-reason vocabulary change. Plan and progress reports are byte-compatible with v0.3.0; fingerprints are unchanged.
Docs
- docs/execution-model.md — the "Create-shape causes" table, pinned by a docs test like the outcome codes (#82)
- docs/schemabot-integration.md — what
LookupOwnedRelationNamesis for and what it excludes (#83)
Contributors
Full changelog: v0.3.0...v0.3.1