/* Check for SERIAL pseudo-types */
is_serial = false;
- if (list_length(column->typename->names) == 1)
+ if (list_length(column->typename->names) == 1 &&
+ !column->typename->pct_type)
{
char *typname = strVal(linitial(column->typename->names));
column->typename->names = NIL;
column->typename->typeid = INT8OID;
}
+
+ /*
+ * We have to reject "serial[]" explicitly, because once we've
+ * set typeid, LookupTypeName won't notice arrayBounds. We don't
+ * need any special coding for serial(typmod) though.
+ */
+ if (is_serial && column->typename->arrayBounds != NIL)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("array of serial is not implemented")));
}
/* Do necessary work on the column type declaration */