77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.35 1998/01/15 19:42: 27pgsql Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.36 1998/01/16 23: 19:27momjian Exp $
1111 *
1212 *
1313 * INTERFACE ROUTINES
@@ -107,6 +107,7 @@ DefaultBuild(Relation heapRelation, Relation indexRelation,
107107 *AttrNumberattnum;
108108 *uint32attnelems;
109109 *int32attcacheoff;
110+ *int16atttypmod;
110111 *boolattbyval;
111112 *boolattisset;
112113 *charattalign;
@@ -117,12 +118,12 @@ DefaultBuild(Relation heapRelation, Relation indexRelation,
117118 * ----------------------------------------------------------------
118119 */
119120static FormData_pg_attribute sysatts []= {
120- {0l , {"ctid" },27l ,0l ,6 ,-1 ,0 ,-1 ,'\0' ,'\0' ,'i' ,'\0' ,'\0' },
121- {0l , {"oid" },26l ,0l ,4 ,-2 ,0 ,-1 ,'\001' ,'\0' ,'i' ,'\0' ,'\0' },
122- {0l , {"xmin" },28l ,0l ,4 ,-3 ,0 ,-1 ,'\0' ,'\0' ,'i' ,'\0' ,'\0' },
123- {0l , {"cmin" },29l ,0l ,4 ,-4 ,0 ,-1 ,'\001' ,'\0' ,'i' ,'\0' ,'\0' },
124- {0l , {"xmax" },28l ,0l ,4 ,-5 ,0 ,-1 ,'\0' ,'\0' ,'i' ,'\0' ,'\0' },
125- {0l , {"cmax" },29l ,0l ,4 ,-6 ,0 ,-1 ,'\001' ,'\0' ,'i' ,'\0' ,'\0' },
121+ {0l , {"ctid" },27l ,0l ,6 ,-1 ,0 ,-1 ,0 , '\0' ,'\0' ,'i' ,'\0' ,'\0' },
122+ {0l , {"oid" },26l ,0l ,4 ,-2 ,0 ,-1 , 0 ,'\001' ,'\0' ,'i' ,'\0' ,'\0' },
123+ {0l , {"xmin" },28l ,0l ,4 ,-3 ,0 ,-1 ,0 , '\0' ,'\0' ,'i' ,'\0' ,'\0' },
124+ {0l , {"cmin" },29l ,0l ,4 ,-4 ,0 ,-1 ,0 , '\001' ,'\0' ,'i' ,'\0' ,'\0' },
125+ {0l , {"xmax" },28l ,0l ,4 ,-5 ,0 ,-1 ,0 , '\0' ,'\0' ,'i' ,'\0' ,'\0' },
126+ {0l , {"cmax" },29l ,0l ,4 ,-6 ,0 ,-1 ,0 , '\001' ,'\0' ,'i' ,'\0' ,'\0' },
126127};
127128
128129/* ----------------------------------------------------------------
@@ -436,6 +437,7 @@ ConstructTupleDescriptor(Oid heapoid,
436437
437438((AttributeTupleForm )to )-> attnotnull = false;
438439((AttributeTupleForm )to )-> atthasdef = false;
440+ ((AttributeTupleForm )to )-> atttypmod = 0 ;
439441
440442/*
441443 * if the keytype is defined, we need to change the tuple form's
@@ -454,11 +456,11 @@ ConstructTupleDescriptor(Oid heapoid,
454456((AttributeTupleForm )to )-> atttypid = tup -> t_oid ;
455457((AttributeTupleForm )to )-> attbyval =
456458((TypeTupleForm ) ((char * )tup + tup -> t_hoff ))-> typbyval ;
457- if (IndexKeyType -> typlen > 0 )
458- ((AttributeTupleForm )to )-> attlen = IndexKeyType -> typlen ;
459- else
460- ((AttributeTupleForm )to )-> attlen =
459+
460+ ((AttributeTupleForm )to )-> attlen =
461461((TypeTupleForm ) ((char * )tup + tup -> t_hoff ))-> typlen ;
462+
463+ ((AttributeTupleForm )to )-> atttypmod = IndexKeyType -> typmod ;
462464}
463465
464466