Repository navigation
executor: judge a create set's changes to a live table together - #739
Conversation
The differ writes one ALTER TABLE per added column. A change that adds a column of a new enum type and a plain column to the same table therefore reaches a create set as two statements, and the plain column's statement was refused for adding no column of a type the set creates. Admission now checks every statement on its own for what it adds, and requires the changes to each table, taken together, to add at least one column of a type the set creates. A table whose changes add none is still refused, naming the table. Signed-off-by: Armand Parajon <armand@squareup.com>
|
🤖 I reviewed the full diff at One optional test improvement in GitHub CI passed its unit tests and PostgreSQL 14–18 matrix. I reviewed the code statically. This was a local static review; I did not run tests. Builderbot review retrieval was unavailable due to a DNS resolution failure. |
A table's changes are now judged together, so a checked-domain column can reach a create set as its own ALTER TABLE beside the enum column. The catalog proof refuses it before the type is created or either column is added. Signed-off-by: Armand Parajon <armand@squareup.com>
|
🤖 Thanks. I added the suggested test in bb7cbad. The subtest "a column whose type rewrites the table, in an ALTER TABLE of its own" sends the enum column and the checked-domain column as separate — Claude Code (Claude Opus 5.5) |
Why
A create set can add columns of its new enum types to a live table. The differ writes one
ALTER TABLEper added column, so a change that addsstatus order_statusand a nullablenote texttoordersreaches the set as two statements. Thenotestatement was refused on its own for adding no column of a type the set creates, which refused the whole table.What
ALTER TABLEis still checked on its own for what it adds: only plain columns, with noIF NOT EXISTS, constraint, generated value, computed default orNOT NULLwithout a default.Upgrade notes
None.
🤖 Generated with Claude Code