summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-01-16 23:21:07 +0000
committerBruce Momjian <bruce@momjian.us>1998-01-16 23:21:07 +0000
commitc65ea0e040f08b59407cd74f8f0f0dd190169d46 (patch)
tree5d46c03cb5ddd61ed5e0693b261965cb2fae8b95 /src/backend/access
parentd7427e4802fd4d7108e37544115cab83c13172ab (diff)
New pg_attribute.atttypmod for type-specific information like
varchar length. Cleans up code so attlen is always length. Removed varchar() hack added earlier. Will fix bug in selecting varchar() fields, and varchar() can be variable length.
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/common/tupdesc.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c
index 9324a95c768..f23c8e86572 100644
--- a/src/backend/access/common/tupdesc.c
+++ b/src/backend/access/common/tupdesc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.31 1998/01/07 21:00:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.32 1998/01/16 23:19:16 momjian Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -301,11 +301,12 @@ TupleDescInitEntry(TupleDesc desc,
att->attdisbursion = 0; /* dummy value */
att->attcacheoff = -1;
+ att->atttypmod = 0;
att->attnum = attributeNumber;
att->attnelems = attdim;
att->attisset = attisset;
-
+
att->attnotnull = false;
att->atthasdef = false;
@@ -512,17 +513,7 @@ BuildDescForRelation(List *schema, char *relname)
typename);
}
- /*
- * this is for char() and varchar(). When an entry is of type
- * char() or varchar(), typlen is set to the appropriate length,
- * which we'll use here instead. (The catalog lookup only returns
- * the length of bpchar and varchar which is not what we want!) -
- * ay 6/95
- */
- if (entry->typename->typlen > 0)
- {
- desc->attrs[attnum - 1]->attlen = entry->typename->typlen;
- }
+ desc->attrs[attnum - 1]->atttypmod = entry->typename->typmod;
/* This is for constraints */
if (entry->is_not_null)