mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Support type modifiers for user-defined types, and pull most knowledge
about typmod representation for standard types out into type-specific typmod I/O functions. Teodor Sigaev, with some editorialization by Tom Lane.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/makefuncs.c,v 1.52 2006/10/04 00:29:53 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/makefuncs.c,v 1.53 2006/12/30 21:21:53 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -262,12 +262,7 @@ makeRangeVar(char *schemaname, char *relname)
|
||||
TypeName *
|
||||
makeTypeName(char *typnam)
|
||||
{
|
||||
TypeName *n = makeNode(TypeName);
|
||||
|
||||
n->names = list_make1(makeString(typnam));
|
||||
n->typmod = -1;
|
||||
n->location = -1;
|
||||
return n;
|
||||
return makeTypeNameFromNameList(list_make1(makeString(typnam)));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -282,14 +277,15 @@ makeTypeNameFromNameList(List *names)
|
||||
TypeName *n = makeNode(TypeName);
|
||||
|
||||
n->names = names;
|
||||
n->typmod = -1;
|
||||
n->typmods = NIL;
|
||||
n->typemod = -1;
|
||||
n->location = -1;
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeTypeNameFromOid -
|
||||
* build a TypeName node to represent a type already known by OID.
|
||||
* build a TypeName node to represent a type already known by OID/typmod.
|
||||
*/
|
||||
TypeName *
|
||||
makeTypeNameFromOid(Oid typeid, int32 typmod)
|
||||
@ -297,7 +293,7 @@ makeTypeNameFromOid(Oid typeid, int32 typmod)
|
||||
TypeName *n = makeNode(TypeName);
|
||||
|
||||
n->typeid = typeid;
|
||||
n->typmod = typmod;
|
||||
n->typemod = typmod;
|
||||
n->location = -1;
|
||||
return n;
|
||||
}
|
||||
|
Reference in New Issue
Block a user