On 23.06.25 18:11, jian he wrote:
seems we didn't check the ALTER TABLE case.
CREATE TYPE double_int as (a int, b int);
CREATE TABLE y (a int);
alter table y add column b double_int GENERATED ALWAYS AS ((a * 2, a *
3)) VIRTUAL;
in ATExecAddColumn, we can change it to:
CheckAttributeType(NameStr(attribute->attname),
attribute->atttypid, attribute->attcollation,
list_make1_oid(rel->rd_rel->reltype),
(attribute->attgenerated ==
ATTRIBUTE_GENERATED_VIRTUAL ? CHKATYPE_IS_VIRTUAL : 0));
Yes, this is an existing fault separate from this patch. I have pushed
a fix for this along these lines.