Repository navigation
Conversation
…r prints it Render refused every sequence-backed default other than an owned serial named <table>_<column>_seq, so a table renamed after it was created, or one on a shared sequence, could not be pulled. Such a default now renders as nextval of the live sequence. The desired build resolves it to that sequence, so the file re-diffs to no change and planning creates no sequence. ErrUnrenderableDefault is deprecated; Render no longer returns it. Signed-off-by: Armand Parajon <armand@squareup.com>
Signed-off-by: Armand Parajon <armand@squareup.com>
|
🤖 Review findings - created by Kiran's code review agent - for pg-sprite/pull/655, 43dcb69. Verdict: 3 findings — 2 non-blocking (stale limitations row, untested row-security admission), 1 suggestion; approve. Non-blocking1. limitations.md still says this default is refused. The "Non-table objects" row says a hand-written 2. A policy-only row-security apply is now admitted on a table like this, and no test covers it. General suggestions3. The one thing that could have broken, verifiedWhether a rendered Verified correct
This review was generated by Claude Code (claude-opus-5-5). |
ErrUnrenderableDefault stays exported for callers that match it, but Render no longer returns it, so it leaves the refusal list, and the completeness test skips a verdict marked Deprecated. limitations.md now says such a default exports as the server prints it, and a test runs a policy change on a table whose default draws from a sequence it does not own. Signed-off-by: Armand Parajon <armand@squareup.com>
|
🤖 All three findings are fixed in acac481:
🤖 Addressed by Claude Code |
Signed-off-by: Armand Parajon <armand@squareup.com>
Why
Renderrefused every sequence-backed default except an owned serial whose sequence is named<table>_<column>_seq. Two common shapes fail that test, and neither table could be pulled:purchases.idkeepsnextval('orders_old_id_seq'::regclass).A consumer that adopts a database from
pullthen has no file for the table.What
"id" bigint DEFAULT nextval('orders_old_id_seq'::regclass) NOT NULL. It is never rendered asserial, which would create a sequence the column does not have.ErrUnrenderableSequenceOptions, and so is a non-serial owned sequence declared that way.ErrUnrenderableDefaultis deprecated, becauseRenderno longer returns it.Before and after
orders_old (id bigserial PRIMARY KEY)was renamed topurchases, so its default still readsnextval('orders_old_id_seq'::regclass).How
A desired build already resolves an unqualified
nextval('<sequence>')to the live sequence through the scratch search path. The scratch table's default then prints exactly as the live one does, so the diff finds no change.renderColumnDefnow falls through to the plain column definition for a sequence default thatserialTypedoes not accept, as long as no sequence declaration would be lost. The new integration test covers a shared sequence with a serial-style name, a renamed serial table, and a true serial. Each one round-trips to no change, and planning leaves the live schema's sequences as they were.Risk
The rendered file names a live sequence it does not create. A file that names a sequence that does not exist still fails its build, as before. The file does not record that a renamed table owns its sequence. The diff does not compare ownership, so that loss changes no plan.
Upgrade notes
ErrUnrenderableDefaultis deprecated.Renderno longer returns it, so a caller that maps it can drop the case.🤖 Generated with Claude Code