Repository navigation
Conversation
First step of creating a partition online: the run creates the table standalone and attaches it with the online attach, which needs the CREATE's own bound as an ATTACH statement.
CREATE TABLE ... PARTITION OF takes ACCESS EXCLUSIVE on the parent; creating the table with LIKE and running the online attach reaches the same partition while the tree keeps serving reads and writes.
…a partition The imperative door refused every CREATE TABLE and pointed at the declarative door, which refuses PARTITION OF too, so adding a partition had no route through pg-sprite.
The run creates a partition online while the dry run refused the statement, so a gate on the dry run blocked a change the run would make.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Review 1/2 (correctness) of 1b66483: 0 blocking, 3 non-blocking. Inspected the whole change at The PR makes Invariants ( Non-blocking
Test case: the dry run and the apply agree on a non-partitioned parent (not run)func TestMigrateAlterDryRunAgreesWithTheApplyOnANonPartitionedParent(t *testing.T) {
url := testutil.StartPostgres(t)
pool, err := dbconn.NewPool(t.Context(), dbconn.Config{URL: url})
require.NoError(t, err)
t.Cleanup(pool.Close)
schema := testutil.NewSchema(t, pool)
_, err = pool.Exec(t.Context(), fmt.Sprintf(
`CREATE TABLE %[1]s.orders (id bigint NOT NULL, day date NOT NULL)`, schema))
require.NoError(t, err)
sql := fmt.Sprintf(`CREATE TABLE %[1]s.orders_2027
PARTITION OF %[1]s.orders
FOR VALUES FROM ('2027-01-01') TO ('2028-01-01')`, schema)
cmd := newMigrateCmd(url, sql)
cmd.DryRun = true
_, dryErr := runMigrate(t, cmd)
_, runErr := runMigrate(t, newMigrateCmd(url, sql))
require.Error(t, runErr, "the apply cannot create a partition of a table that is not partitioned")
assert.Error(t, dryErr, "the dry run must not report it executable")
}
Verified
This review was generated by Claude Code (claude-sonnet-5-5). |
|
🤖 Review 2/2 (OSS adoption and integration) of 1b66483: 0 blocking, 4 non-blocking. Read the change from two seats: an operator or CI author who pins a Non-blocking
What reads well for adopters
This review was generated by Claude Code (claude-sonnet-5-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Stamping with comments: 0 blocking, 7 non-blocking (see the review comments above).
This stamp was left by Claude Code (claude-sonnet-5-5).
|
🤖 I reviewed all 18 changed files at Verify the stopped-child refusal still names the parent. The old apply path called the refusal helper with the parent-targeted GitHub reported all 18 checks successful. I did not run local tests. Direct Builderbot lookup failed to resolve its host. GitHub showed no current-head Builderbot check or review, and I did not independently enumerate unresolved inline threads. |
JashLal
left a comment
There was a problem hiding this comment.
🤖 Approved by Codex on Jash’s behalf after reviewing the current head. See my substantive review comment for findings and validation limits.
migrate --dry-runnow plans a bareCREATE TABLE … PARTITION OF … FOR VALUES …as the online create of a partition, with a newonline-create-partitionexecution in the plan report (format version 47), instead of refusing it.Why
A dry run is how an operator, or an orchestrator such as a CI gate, previews a change before it runs. The previous PR taught the run to add a partition without locking the partitioned table, but left the dry run refusing the same statement, so anything that gates on the dry run would block a change the run makes safely. This PR makes the preview say what the run will do.
What
PARTITION OFdown its own short path: the run's pre-read checks, then a plan on the partitioned parent (schema/tableare the parent's) whose one statement executes withexecution: online-create-partitionandexec_sqlthe statement itself.migrate.AdmitCreatePartitionis the shared admission, used by both the run and the dry run: acknowledgements are a usage error, an unqualified parent is refused, and a copy-and-swap run stopped on a table of the new partition's name refuses it, each with the run's verdict. It is listed among the stopped-run checks the front-door walk test recognizes.planner.ExecutionOnlineCreatePartitionjoins the closed execution set, and the fingerprint covers it (as it doesonline-attach), so a pin on the online plan cannot carry over to the statement run as written.plan.RouteOnlineCreatePartitionmarks the statement.FormatVersion46 → 47, with the version history, the execution table, and the fingerprint paragraph indocs/plan-report.md, every pinned example, and the demo'sformat_versionassertions moved to 47.limitations.md, andschemabot-integration.mdnow say the dry run plans it. Like the online attach's dry run, it does not read the parent'sDEFAULTpartition, which only the run refuses.Before / after
The same statement through
--dry-runand through the run:An unqualified parent or a
DEFAULTbound is refused the same way by both.