88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.356 2009/07/30 02:45:36 tgl Exp $
11+ * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.357 2009/08/02 22:14:52 tgl Exp $
1212 *
1313 *
1414 * INTERFACE ROUTINES
@@ -111,37 +111,37 @@ static List *insert_ordered_unique_oid(List *list, Oid datum);
111111 */
112112
113113static FormData_pg_attribute a1 = {
114- 0 , {"ctid" }, TIDOID , 0 , sizeof (ItemPointerData ),
114+ 0 , {"ctid" }, TIDOID , 0 , 0 , sizeof (ItemPointerData ),
115115 SelfItemPointerAttributeNumber , 0 , -1 , -1 ,
116116 false, 'p' , 's' , true, false, false, true, 0 , {0 }
117117};
118118
119119static FormData_pg_attribute a2 = {
120- 0 , {"oid" }, OIDOID , 0 , sizeof (Oid ),
120+ 0 , {"oid" }, OIDOID , 0 , 0 , sizeof (Oid ),
121121 ObjectIdAttributeNumber , 0 , -1 , -1 ,
122122 true, 'p' , 'i' , true, false, false, true, 0 , {0 }
123123};
124124
125125static FormData_pg_attribute a3 = {
126- 0 , {"xmin" }, XIDOID , 0 , sizeof (TransactionId ),
126+ 0 , {"xmin" }, XIDOID , 0 , 0 , sizeof (TransactionId ),
127127 MinTransactionIdAttributeNumber , 0 , -1 , -1 ,
128128 true, 'p' , 'i' , true, false, false, true, 0 , {0 }
129129};
130130
131131static FormData_pg_attribute a4 = {
132- 0 , {"cmin" }, CIDOID , 0 , sizeof (CommandId ),
132+ 0 , {"cmin" }, CIDOID , 0 , 0 , sizeof (CommandId ),
133133 MinCommandIdAttributeNumber , 0 , -1 , -1 ,
134134 true, 'p' , 'i' , true, false, false, true, 0 , {0 }
135135};
136136
137137static FormData_pg_attribute a5 = {
138- 0 , {"xmax" }, XIDOID , 0 , sizeof (TransactionId ),
138+ 0 , {"xmax" }, XIDOID , 0 , 0 , sizeof (TransactionId ),
139139 MaxTransactionIdAttributeNumber , 0 , -1 , -1 ,
140140 true, 'p' , 'i' , true, false, false, true, 0 , {0 }
141141};
142142
143143static FormData_pg_attribute a6 = {
144- 0 , {"cmax" }, CIDOID , 0 , sizeof (CommandId ),
144+ 0 , {"cmax" }, CIDOID , 0 , 0 , sizeof (CommandId ),
145145 MaxCommandIdAttributeNumber , 0 , -1 , -1 ,
146146 true, 'p' , 'i' , true, false, false, true, 0 , {0 }
147147};
@@ -153,7 +153,7 @@ static FormData_pg_attribute a6 = {
153153 * used in SQL.
154154 */
155155static FormData_pg_attribute a7 = {
156- 0 , {"tableoid" }, OIDOID , 0 , sizeof (Oid ),
156+ 0 , {"tableoid" }, OIDOID , 0 , 0 , sizeof (Oid ),
157157 TableOidAttributeNumber , 0 , -1 , -1 ,
158158 true, 'p' , 'i' , true, false, false, true, 0 , {0 }
159159};
@@ -501,6 +501,7 @@ InsertPgAttributeTuple(Relation pg_attribute_rel,
501501 values [Anum_pg_attribute_attname - 1 ] = NameGetDatum (& new_attribute -> attname );
502502 values [Anum_pg_attribute_atttypid - 1 ] = ObjectIdGetDatum (new_attribute -> atttypid );
503503 values [Anum_pg_attribute_attstattarget - 1 ] = Int32GetDatum (new_attribute -> attstattarget );
504+ values [Anum_pg_attribute_attdistinct - 1 ] = Float4GetDatum (new_attribute -> attdistinct );
504505 values [Anum_pg_attribute_attlen - 1 ] = Int16GetDatum (new_attribute -> attlen );
505506 values [Anum_pg_attribute_attnum - 1 ] = Int16GetDatum (new_attribute -> attnum );
506507 values [Anum_pg_attribute_attndims - 1 ] = Int32GetDatum (new_attribute -> attndims );
@@ -571,6 +572,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
571572 attr -> attrelid = new_rel_oid ;
572573 /* Make sure these are OK, too */
573574 attr -> attstattarget = -1 ;
575+ attr -> attdistinct = 0 ;
574576 attr -> attcacheoff = -1 ;
575577
576578 InsertPgAttributeTuple (rel , attr , indstate );
0 commit comments