mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Support arrays of composite types, including the rowtypes of regular tables
and views (but not system catalogs, nor sequences or toast tables). Get rid of the hardwired convention that a type's array type is named exactly "_type", instead using a new column pg_type.typarray to provide the linkage. (It still will be named "_type", though, except in odd corner cases such as maximum-length type names.) Along the way, make tracking of owner and schema dependencies for types more uniform: a type directly created by the user has these dependencies, while a table rowtype or auto-generated array type does not have them, but depends on its parent object instead. David Fetter, Andrew Dunstan, Tom Lane
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.89 2007/04/27 22:05:48 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.90 2007/05/11 17:57:12 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -116,10 +116,6 @@ LookupTypeName(ParseState *pstate, const TypeName *typename)
|
||||
/* deconstruct the name list */
|
||||
DeconstructQualifiedName(typename->names, &schemaname, &typname);
|
||||
|
||||
/* If an array reference, look up the array type instead */
|
||||
if (typename->arrayBounds != NIL)
|
||||
typname = makeArrayTypeName(typname);
|
||||
|
||||
if (schemaname)
|
||||
{
|
||||
/* Look in specific schema only */
|
||||
@@ -136,6 +132,10 @@ LookupTypeName(ParseState *pstate, const TypeName *typename)
|
||||
/* Unqualified type name, so search the search path */
|
||||
restype = TypenameGetTypid(typname);
|
||||
}
|
||||
|
||||
/* If an array reference, return the array type instead */
|
||||
if (typename->arrayBounds != NIL)
|
||||
restype = get_array_type(restype);
|
||||
}
|
||||
|
||||
return restype;
|
||||
|
||||
Reference in New Issue
Block a user