diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-12-30 21:21:56 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-12-30 21:21:56 +0000 |
commit | 5725b9d9afc8c3ba24e94cbc7020889fe8ad7ef9 (patch) | |
tree | e1c8a77dbb660fa0de36528f19dc4f3cb81829d2 /src/backend/access | |
parent | 24b1f14eae0b83ef5d6b269ebf1ecae2f3acbb8c (diff) | |
download | postgresql-5725b9d9afc8c3ba24e94cbc7020889fe8ad7ef9.tar.gz postgresql-5725b9d9afc8c3ba24e94cbc7020889fe8ad7ef9.zip |
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.
Diffstat (limited to 'src/backend/access')
-rw-r--r-- | src/backend/access/common/tupdesc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index 6242afa20f3..be5665db79c 100644 --- a/src/backend/access/common/tupdesc.c +++ b/src/backend/access/common/tupdesc.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.118 2006/07/14 14:52:16 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.119 2006/12/30 21:21:52 tgl Exp $ * * NOTES * some of the executor utility code such as "ExecTypeFromTL" should be @@ -508,6 +508,7 @@ BuildDescForRelation(List *schema) AttrDefault *attrdef = NULL; TupleConstr *constr = (TupleConstr *) palloc0(sizeof(TupleConstr)); char *attname; + Oid atttypid; int32 atttypmod; int attdim; int ndef = 0; @@ -533,7 +534,8 @@ BuildDescForRelation(List *schema) attnum++; attname = entry->colname; - atttypmod = entry->typename->typmod; + atttypid = typenameTypeId(NULL, entry->typename); + atttypmod = typenameTypeMod(NULL, entry->typename, atttypid); attdim = list_length(entry->typename->arrayBounds); if (entry->typename->setof) @@ -543,8 +545,7 @@ BuildDescForRelation(List *schema) attname))); TupleDescInitEntry(desc, attnum, attname, - typenameTypeId(NULL, entry->typename), - atttypmod, attdim); + atttypid, atttypmod, attdim); /* Fill in additional stuff not handled by TupleDescInitEntry */ if (entry->is_not_null) |