Repository navigation
Schema change: put the real-PostgreSQL checks in the repo, and say what has and has not been checked - #7
Merged
Conversation
…ostgreSQL 12 to 18 scripts/schema-change-pg.ts runs 15 sections against a real server: lock levels read from pg_locks, which type changes rewrite a table, every compiled scenario run and compared with the compiler's predicted end state, the drop and dependency rules against what PostgreSQL refuses, the pre-flight check and lock retry with real sessions, the table rename with real roles and grants, and the probes. scripts/schema-change-versions.sh starts one container per version, 12 to 18, runs it and removes the containers. npm run test:schema-pg and test:schema-pg:versions.
…nd on the page The README described a page that opens a runbook and runs nothing, tested on PostgreSQL 16. It now describes the pre-flight check, running one step at a time, the lock retry and the comparison after the last step, and lists what was checked on real servers (PostgreSQL 12 to 18), what was checked on small data only, what was not run against a real server, and what the model's answers are and are not checked for. The page has the same list as a note.
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.
What changed
scripts/schema-change-pg.ts(renamed from the localschema-change-pg16.ts, since it covers 12 to 18) runs 15 sections against a real server: lock levels read frompg_locks; which type changes rewrite a table; every compiled scenario run and compared with the compiler's predicted end state; the drop and dependency rules against what PostgreSQL itself refuses; the pre-flight check and the lock retry with real sessions (including a role that cannot read other sessions); the table rename with real roles, grants and row-level security; and the probes of defaults and checks.scripts/schema-change-versions.shstarts one container per version (12, 13, 14, 15, 16, 17, 18), runs the script and removes the containers.scripts/lib/pg-scratch.tsandscripts/lib/plan-runner.tsare its helpers.npm run test:schema-pgandnpm run test:schema-pg:versions(two lines added topackage.json; nothing else in it changed).How it was checked
scripts/schema-change-versions.sh 12 18was run end to end for this PR: all 15 sections pass on PostgreSQL 12 and on 18 (earlier runs covered 13 to 17 with the same sections).Reviewer notes
npm run eval:schema); that script is still not in the repository and the README now says so.