@@ -145,11 +145,11 @@ statext_is_kind_built(HeapTuple htup, char type)
145145switch (type )
146146{
147147case STATS_EXT_NDISTINCT :
148- attnum = Anum_pg_statistic_ext_standistinct ;
148+ attnum = Anum_pg_statistic_ext_stxndistinct ;
149149break ;
150150
151151case STATS_EXT_DEPENDENCIES :
152- attnum = Anum_pg_statistic_ext_stadependencies ;
152+ attnum = Anum_pg_statistic_ext_stxdependencies ;
153153break ;
154154
155155default :
@@ -175,7 +175,7 @@ fetch_statentries_for_relation(Relation pg_statext, Oid relid)
175175 * rel.
176176 */
177177ScanKeyInit (& skey ,
178- Anum_pg_statistic_ext_starelid ,
178+ Anum_pg_statistic_ext_stxrelid ,
179179BTEqualStrategyNumber ,F_OIDEQ ,
180180ObjectIdGetDatum (relid ));
181181
@@ -195,23 +195,23 @@ fetch_statentries_for_relation(Relation pg_statext, Oid relid)
195195entry = palloc0 (sizeof (StatExtEntry ));
196196entry -> statOid = HeapTupleGetOid (htup );
197197staForm = (Form_pg_statistic_ext )GETSTRUCT (htup );
198- entry -> schema = get_namespace_name (staForm -> stanamespace );
199- entry -> name = pstrdup (NameStr (staForm -> staname ));
200- for (i = 0 ;i < staForm -> stakeys .dim1 ;i ++ )
198+ entry -> schema = get_namespace_name (staForm -> stxnamespace );
199+ entry -> name = pstrdup (NameStr (staForm -> stxname ));
200+ for (i = 0 ;i < staForm -> stxkeys .dim1 ;i ++ )
201201{
202202entry -> columns = bms_add_member (entry -> columns ,
203- staForm -> stakeys .values [i ]);
203+ staForm -> stxkeys .values [i ]);
204204}
205205
206- /* decode thestaenabled char array into a list of chars */
206+ /* decode thestxkind char array into a list of chars */
207207datum = SysCacheGetAttr (STATEXTOID ,htup ,
208- Anum_pg_statistic_ext_staenabled ,& isnull );
208+ Anum_pg_statistic_ext_stxkind ,& isnull );
209209Assert (!isnull );
210210arr = DatumGetArrayTypeP (datum );
211211if (ARR_NDIM (arr )!= 1 ||
212212ARR_HASNULL (arr )||
213213ARR_ELEMTYPE (arr )!= CHAROID )
214- elog (ERROR ,"staenabled is not a 1-D char array" );
214+ elog (ERROR ,"stxkind is not a 1-D char array" );
215215enabled = (char * )ARR_DATA_PTR (arr );
216216for (i = 0 ;i < ARR_DIMS (arr )[0 ];i ++ )
217217{
@@ -231,7 +231,7 @@ fetch_statentries_for_relation(Relation pg_statext, Oid relid)
231231/*
232232 * Using 'vacatts' of size 'nvacatts' as input data, return a newly built
233233 * VacAttrStats array which includes only the items corresponding to
234- * attributes indicated by 'stakeys '. If we don't have all of the per column
234+ * attributes indicated by 'stxkeys '. If we don't have all of the per column
235235 * stats available to compute the extended stats, then we return NULL to indicate
236236 * to the caller that the stats should not be built.
237237 */
@@ -310,21 +310,21 @@ statext_store(Relation pg_stext, Oid statOid,
310310{
311311bytea * data = statext_ndistinct_serialize (ndistinct );
312312
313- nulls [Anum_pg_statistic_ext_standistinct - 1 ]= (data == NULL );
314- values [Anum_pg_statistic_ext_standistinct - 1 ]= PointerGetDatum (data );
313+ nulls [Anum_pg_statistic_ext_stxndistinct - 1 ]= (data == NULL );
314+ values [Anum_pg_statistic_ext_stxndistinct - 1 ]= PointerGetDatum (data );
315315}
316316
317317if (dependencies != NULL )
318318{
319319bytea * data = statext_dependencies_serialize (dependencies );
320320
321- nulls [Anum_pg_statistic_ext_stadependencies - 1 ]= (data == NULL );
322- values [Anum_pg_statistic_ext_stadependencies - 1 ]= PointerGetDatum (data );
321+ nulls [Anum_pg_statistic_ext_stxdependencies - 1 ]= (data == NULL );
322+ values [Anum_pg_statistic_ext_stxdependencies - 1 ]= PointerGetDatum (data );
323323}
324324
325325/* always replace the value (either by bytea or NULL) */
326- replaces [Anum_pg_statistic_ext_standistinct - 1 ]= true;
327- replaces [Anum_pg_statistic_ext_stadependencies - 1 ]= true;
326+ replaces [Anum_pg_statistic_ext_stxndistinct - 1 ]= true;
327+ replaces [Anum_pg_statistic_ext_stxdependencies - 1 ]= true;
328328
329329/* there should already be a pg_statistic_ext tuple */
330330oldtup = SearchSysCache1 (STATEXTOID ,ObjectIdGetDatum (statOid ));