Repository navigation
test(pg): every control-plane statement's parameters must bind as declared (#1384) - #1428
Merged
Merged
Conversation
…lared (#1384) er-entity analyse plans each statement but cannot know what type Postgres INFERS for a parameter. A declared bigint inside make_interval(secs => $x) (inferred float8) planned cleanly and failed every call with WrongType. The spot-reclaim requeue and the capacity wait were broken that way until #1383, and nothing executed them. pg_param_types prepares all 214 Postgres statements on the reconciled schema and checks, for each of their 852 parameters, that the Rust type the emitter binds for its declared type accepts what Postgres inferred. The mapping mirrors er-sql-check's param_arg_type, and an unmapped type fails to compile. A params entry it cannot read fails rather than being skipped. With #1383's cast reverted it names exactly capacity_wait and requeue_launch. It is a pg test rather than an E0xx code because only a real Postgres knows the inferred type, and er-entity verify runs without one. It runs in CI's pg slices with every other pg_* test. sql-analysis records the gate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 29, 2026 09:37 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Closes #1384
What
New
pg_param_typesprepares every control-plane statement (214) against the reconciled schema. For each of their 852 parameters it checks that the Rust type the emitter binds for the declared typeacceptsthe type Postgres infers. The failure message names the statement, the parameter, both types and the fix (a cast in the SQL). sql-analysis records the gate.Why
er-entity analysecannot know Postgres's inferred parameter types. A declaredbigintinsidemake_interval(secs => $x)(inferredfloat8) planned cleanly and failed every call withWrongType. That shipped inrequeue_launchandcapacity_wait(#1383), and was caught before review in #544'senqueue_deferred. Decision: a pg test rather than a new E0xx code, because only a real Postgres knows the inferred type ander-entity verifyruns without one. As apg_*test it runs in CI's pg slices.Proof
make checkexit 0. Real Postgres: 214 statements, 852 parameters, pass. The required first run: with #1383's cast reverted it fails, naming exactlycapacity_waitandrequeue_launch(declared Bigint … Postgres infers float8). A params entry the parser can't read fails rather than being skipped.Risk & rollback
Test only. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-29T10:41:53Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not: — a7ffca5, rust 46248352307 + frontend 46248352324 success; pg_param_types ran in the pg slices
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 46248352389
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — run 46248780292 success; test only
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra, devcontainer success on a7ffca5
Donethrough the automation rather than byhand, and the issue closed: — Analyser: a declared parameter type that disagrees with Postgres's inferred type should fail (new E0xx) #1384 CLOSED by test(pg): every control-plane statement's parameters must bind as declared (#1384) #1428 via automation
(a skill, a reference, memory) — or nothing new was learned: — sql-analysis SKILL names the gate; a declared type is fixed by a cast in the SQL, never by changing the declaration
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
The type mapping mirrors er-sql-check's
param_arg_type. The test lives in er-server so it rides the existing pg CI slices, without pulling DataFusion into er-server's test build.🤖 Generated with Claude Code