Index: src/backend/commands/tablecmds.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/commands/tablecmds.c,v retrieving revision 1.218 diff -c -r1.218 tablecmds.c *** src/backend/commands/tablecmds.c 19 Mar 2007 23:38:29 -0000 1.218 --- src/backend/commands/tablecmds.c 26 Mar 2007 00:30:08 -0000 *************** *** 287,298 **** Datum reloptions; ListCell *listptr; AttrNumber attnum; /* ! * Truncate relname to appropriate length (probably a waste of time, as ! * parser should have done this already). */ ! StrNCpy(relname, stmt->relation->relname, NAMEDATALEN); /* * Check consistency of arguments --- 287,307 ---- Datum reloptions; ListCell *listptr; AttrNumber attnum; + char *relarrayname; /* ! * Truncate relname to appropriate length (probably a waste of time, as * ! * parser should have done this already). Because tables and views now get ! * an array type, this depends on the relkind. */ ! if (relkind == 'r' || relkind == 'v' && !IsBootstrapProcessingMode()) ! { ! StrNCpy(relname, stmt->relation->relname, NAMEDATALEN-2); ! } ! else ! { ! StrNCpy(relname, stmt->relation->relname, NAMEDATALEN); ! } /* * Check consistency of arguments *************** *** 496,501 **** --- 505,543 ---- */ relation_close(rel, NoLock); + /* + * Add the array type if appropriate. + */ + if (relkind == 'r' || relkind == 'v' && !IsBootstrapProcessingMode()) + { + relarrayname = makeArrayTypeName(relname); + TypeCreate(relarrayname, /* Array type name */ + namespaceId, /* Same namespace as parent */ + InvalidOid, /* relation oid, N/A here */ + 0, /* relkind, also N/A here */ + -1, /* Internal size, unlimited */ + 'c', /* It's a complex type */ + DEFAULT_TYPDELIM, /* Use the default */ + F_ARRAY_IN, /* Macro for array input procedure */ + F_ARRAY_OUT, /* Macro for array output procedure */ + F_ARRAY_RECV, /* Macro for array receive (binary input) procedure */ + F_ARRAY_SEND, /* Macro for array send (binary output) procedure */ + -1, /* No input typmod */ + -1, /* No output typmod */ + InvalidOid, /* Default ANALYZE procedure */ + relationId, /* The OID just created */ + InvalidOid, /* No base type--this isn't a DOMAIN */ + NULL, /* No default type value */ + NULL, /* Don't send binary */ + false, /* Never passed by value */ + 'd', /* Type alignment. Should this be something else? */ + 'x', /* Always TOASTable */ + -1, /* No typMod for regular composite types. When we have domains over these, we should revisit. */ + 0, /* Array diminsions of typbasetype */ + false); /* Type NOT NULL */ + pfree(relarrayname); /* Seems like the right thing to do here. */ + } + return relationId; } Index: src/include/catalog/catversion.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/catalog/catversion.h,v retrieving revision 1.394 diff -c -r1.394 catversion.h *** src/include/catalog/catversion.h 25 Mar 2007 11:56:04 -0000 1.394 --- src/include/catalog/catversion.h 26 Mar 2007 00:30:10 -0000 *************** *** 48,58 **** * We could use anything we wanted for version numbers, but I recommend * following the "YYYYMMDDN" style often used for DNS zone serial numbers. * YYYYMMDD are the date of the change, and N is the number of the change ! * on that day. (Hopefully we'll never commit ten independent sets of ! * catalog changes on the same day...) */ /* yyyymmddN */ ! #define CATALOG_VERSION_NO 200703251 #endif --- 48,58 ---- * We could use anything we wanted for version numbers, but I recommend * following the "YYYYMMDDN" style often used for DNS zone serial numbers. * YYYYMMDD are the date of the change, and N is the number of the change ! * on that day. (Let's hope we'll never commit ten independent sets ! * of catalog changes on the same day...) */ /* yyyymmddN */ ! #define CATALOG_VERSION_NO 200703252 #endif