diff options
Diffstat (limited to 'src/backend/catalog/index.c')
| -rw-r--r-- | src/backend/catalog/index.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index c98c877d7d..6772f8b665 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.35 1998/01/15 19:42:27 pgsql Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.36 1998/01/16 23:19:27 momjian Exp $ * * * INTERFACE ROUTINES @@ -107,6 +107,7 @@ DefaultBuild(Relation heapRelation, Relation indexRelation, * AttrNumber attnum; * uint32 attnelems; * int32 attcacheoff; + * int16 atttypmod; * bool attbyval; * bool attisset; * char attalign; @@ -117,12 +118,12 @@ DefaultBuild(Relation heapRelation, Relation indexRelation, * ---------------------------------------------------------------- */ static FormData_pg_attribute sysatts[] = { - {0l, {"ctid"}, 27l, 0l, 6, -1, 0, -1, '\0', '\0', 'i', '\0', '\0'}, - {0l, {"oid"}, 26l, 0l, 4, -2, 0, -1, '\001', '\0', 'i', '\0', '\0'}, - {0l, {"xmin"}, 28l, 0l, 4, -3, 0, -1, '\0', '\0', 'i', '\0', '\0'}, - {0l, {"cmin"}, 29l, 0l, 4, -4, 0, -1, '\001', '\0', 'i', '\0', '\0'}, - {0l, {"xmax"}, 28l, 0l, 4, -5, 0, -1, '\0', '\0', 'i', '\0', '\0'}, - {0l, {"cmax"}, 29l, 0l, 4, -6, 0, -1, '\001', '\0', 'i', '\0', '\0'}, + {0l, {"ctid"}, 27l, 0l, 6, -1, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'}, + {0l, {"oid"}, 26l, 0l, 4, -2, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'}, + {0l, {"xmin"}, 28l, 0l, 4, -3, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'}, + {0l, {"cmin"}, 29l, 0l, 4, -4, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'}, + {0l, {"xmax"}, 28l, 0l, 4, -5, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'}, + {0l, {"cmax"}, 29l, 0l, 4, -6, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'}, }; /* ---------------------------------------------------------------- @@ -436,6 +437,7 @@ ConstructTupleDescriptor(Oid heapoid, ((AttributeTupleForm) to)->attnotnull = false; ((AttributeTupleForm) to)->atthasdef = false; + ((AttributeTupleForm) to)->atttypmod = 0; /* * if the keytype is defined, we need to change the tuple form's @@ -454,11 +456,11 @@ ConstructTupleDescriptor(Oid heapoid, ((AttributeTupleForm) to)->atttypid = tup->t_oid; ((AttributeTupleForm) to)->attbyval = ((TypeTupleForm) ((char *) tup + tup->t_hoff))->typbyval; - if (IndexKeyType->typlen > 0) - ((AttributeTupleForm) to)->attlen = IndexKeyType->typlen; - else - ((AttributeTupleForm) to)->attlen = + + ((AttributeTupleForm) to)->attlen = ((TypeTupleForm) ((char *) tup + tup->t_hoff))->typlen; + + ((AttributeTupleForm) to)->atttypmod = IndexKeyType->typmod; } |
