hi. while looking at tablecmd.c, BuildDescForRelation attdim = list_length(entry->typeName->arrayBounds); if (attdim > PG_INT16_MAX) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many array dimensions"))
makes me related to array_in refactor previously we did. at first, i thought it should be "if (attdim > MAXDIM)" pg_attribute attndims description in [1] attndims int2 Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means “it's an array”.) pg_type typndims description in [2] typndims int4 typndims is the number of array dimensions for a domain over an array (that is, typbasetype is an array type). Zero for types other than domains over array types. since array_in is the only source of the real array data. MAXDIM (6) ensure the max dimension is 6. Can we error out at the stage "create table", "create domain" time if the attndims or typndims is larger than MAXDIM (6) ? for example, error out the following queries immediately create table t112(a int[][] [][] [][] [][][]); create domain d_text_arr text [1][][][][][][][]; in the doc, we can still say "the number of dimensions of an array is not enforced", but attndims, typndims value would be within a sane threshold. We can change typndims from int4 to int2, so array type's dimension is consistent with domain type's dimension. but it seems with the change, pg_type occupies the same amount of storage as int4. [1] https://www.postgresql.org/docs/current/catalog-pg-attribute.html [2] https://www.postgresql.org/docs/current/catalog-pg-type.html