Context
PR #498 (issue #496) changed the create path for partition children from standalone CREATE TABLE to CREATE TABLE ... PARTITION OF ... FOR VALUES .... This correctly attaches children to their parent and handles child-specific constraints (via conparentid = 0 filtering).
Gap
PostgreSQL's PARTITION OF grammar accepts a full OptTypedTableElementList, which includes column-level elements beyond table constraints:
CREATE TABLE child PARTITION OF parent (
col1 WITH OPTIONS DEFAULT 42, -- per-child default override
col2 WITH OPTIONS NOT NULL -- per-child NOT NULL override
) FOR VALUES IN ('value');
The current PARTITION OF branch in generateTableSQL only serializes child-specific table constraints. It does not emit per-child column-level overrides (defaults, identity, generated expressions, storage parameters).
Impact
Low — per-child column overrides on partition children are uncommon in practice. The parent's column definitions are inherited automatically, and most schemas don't override them per-child.
Proposed fix
If the IR shows a child column with a different default/identity/generated expression than the parent column, emit it as a WITH OPTIONS element in the PARTITION OF statement.
Related: #496, PR #498
Context
PR #498 (issue #496) changed the create path for partition children from standalone
CREATE TABLEtoCREATE TABLE ... PARTITION OF ... FOR VALUES .... This correctly attaches children to their parent and handles child-specific constraints (viaconparentid = 0filtering).Gap
PostgreSQL's
PARTITION OFgrammar accepts a fullOptTypedTableElementList, which includes column-level elements beyond table constraints:The current
PARTITION OFbranch ingenerateTableSQLonly serializes child-specific table constraints. It does not emit per-child column-level overrides (defaults, identity, generated expressions, storage parameters).Impact
Low — per-child column overrides on partition children are uncommon in practice. The parent's column definitions are inherited automatically, and most schemas don't override them per-child.
Proposed fix
If the IR shows a child column with a different default/identity/generated expression than the parent column, emit it as a
WITH OPTIONSelement in thePARTITION OFstatement.Related: #496, PR #498