docs+lint: safer forms are not semantic equivalents - #13
Open
Kiran01bm wants to merge 1 commit into
Open
Conversation
CREATE INDEX and CREATE INDEX CONCURRENTLY converge on the same declared end state but differ operationally: locking, transactionality, and failure modes (a failed CONCURRENTLY build leaves an INVALID index the executor must detect via pg_index.indisvalid and recover). Reword docs, API comments, and CLI output so recommendations read as advisory safer forms the engine owns executing, never as equivalents or instructions to run manually.
Kiran01bm
marked this pull request as ready for review
August 6, 2026 10:25
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
CREATE INDEXandCREATE INDEX CONCURRENTLYconverge on the same declared end state butare not semantic equivalents — different locking, transactionality, and failure modes.
This PR sweeps docs, API comments, and CLI output so every safer-rewrite recommendation
reads as an advisory safer form the engine owns executing, never as an equivalent or an
instruction to run manually. No behavior change.
What
docs/design-principles.md,docs/high-level-design.md,docs/low-level-design.md:replace "native equivalent" / "safer equivalent" with "safer native form" and state the
operational differences (a failed
CONCURRENTLYbuild leaves anINVALIDindex theexecutor must detect via
pg_index.indisvalidand recover); the HLD advisory diagram nowsays
safer form:instead ofrun instead:.pkg/planner(Decision.SaferSQL) andpkg/lint(CodeBlockingIdiom,Finding.Suggestion) doc comments carry the same caveat.lintprintssafer form (not equivalent — see docs/postgres-online-ddl-reference.md);diffdry-run printssafer form the engine would run (not equivalent — …)instead ofthe engine would run instead:.Why
A recommendation that prints "run instead: CREATE INDEX CONCURRENTLY …" invites an operator
to paste it into
psql— bypassing the engine's execution-time guards (invalid-indexdetection and recovery) while implying identical semantics. The distinction is declarative
vs. operational: from a desired-state diff standpoint the end state is identical
(
CONCURRENTLYis not catalog state), but the execution paths fail differently, and onlythe engine owns the recovery. Wording everywhere now matches the execution-safety model in
docs/postgres-online-ddl-reference.md.