errmsg("column \"%s\" has pseudo-type %s",
attname, format_type_be(atttypid))));
}
+ else if (att_typtype == TYPTYPE_DOMAIN)
+ {
+ /*
+ * If it's a domain, recurse to check its base type.
+ */
+ CheckAttributeType(attname, getBaseType(atttypid), attcollation,
+ containing_rowtypes,
+ allow_system_table_mods);
+ }
else if (att_typtype == TYPTYPE_COMPOSITE)
{
/*
- * For a composite type, recurse into its attributes. You might think
- * this isn't necessary, but since we allow system catalogs to break
- * the rule, we have to guard against the case.
+ * For a composite type, recurse into its attributes.
*/
Relation relation;
TupleDesc tupdesc;
ERROR: composite type recur1 cannot be made a member of itself
alter table recur1 add column f2 recur1[]; -- fails
ERROR: composite type recur1 cannot be made a member of itself
+create domain array_of_recur1 as recur1[];
+alter table recur1 add column f2 array_of_recur1; -- fails
+ERROR: composite type recur1 cannot be made a member of itself
create temp table recur2 (f1 int, f2 recur1);
alter table recur1 add column f2 recur2; -- fails
ERROR: composite type recur1 cannot be made a member of itself
create temp table recur1 (f1 int);
alter table recur1 add column f2 recur1; -- fails
alter table recur1 add column f2 recur1[]; -- fails
+create domain array_of_recur1 as recur1[];
+alter table recur1 add column f2 array_of_recur1; -- fails
create temp table recur2 (f1 int, f2 recur1);
alter table recur1 add column f2 recur2; -- fails
alter table recur1 add column f2 int;