@@ -310,10 +310,10 @@ postgresGetForeignRelSize(PlannerInfo *root,
310310 {
311311 for (j = 0 ; j < vops_tupdesc -> natts ; j ++ )
312312 {
313- if (strcmp (NameStr (vops_tupdesc -> attrs [ j ] -> attname ), NameStr (fdw_tupdesc -> attrs [ i ] -> attname )) == 0 )
313+ if (strcmp (NameStr (TupleDescAttr ( vops_tupdesc , j ) -> attname ), NameStr (TupleDescAttr ( fdw_tupdesc , i ) -> attname )) == 0 )
314314 {
315315 fpinfo -> vops_attrs = bms_add_member (fpinfo -> vops_attrs , i + 1 - FirstLowInvalidHeapAttributeNumber );
316- if (vops_get_type (vops_tupdesc -> attrs [ j ] -> atttypid ) != VOPS_LAST )
316+ if (vops_get_type (TupleDescAttr ( vops_tupdesc , j ) -> atttypid ) != VOPS_LAST )
317317 {
318318 fpinfo -> tile_attrs = bms_add_member (fpinfo -> tile_attrs , i + 1 - FirstLowInvalidHeapAttributeNumber );
319319 }
@@ -685,7 +685,7 @@ postgresIterateForeignScan(ForeignScanState *node)
685685 /* ordinary column */
686686 Assert (i <= n_attrs );
687687 Assert (j < SPI_tuptable -> tupdesc -> natts );
688- fsstate -> attr_types [i - 1 ] = SPI_tuptable -> tupdesc -> attrs [ j ] -> atttypid ;
688+ fsstate -> attr_types [i - 1 ] = TupleDescAttr ( SPI_tuptable -> tupdesc , j ) -> atttypid ;
689689 fsstate -> vops_types [i - 1 ] = vops_get_type (fsstate -> attr_types [i - 1 ]);
690690 }
691691 j += 1 ;
@@ -747,7 +747,7 @@ postgresIterateForeignScan(ForeignScanState *node)
747747 fsstate -> dst_nulls [i ] = false;
748748 }
749749 } else {
750- if (fsstate -> attr_types [i ] == FLOAT8OID && fsstate -> tupdesc -> attrs [ i ] -> atttypid == FLOAT4OID )
750+ if (fsstate -> attr_types [i ] == FLOAT8OID && TupleDescAttr ( fsstate -> tupdesc , i ) -> atttypid == FLOAT4OID )
751751 {
752752 fsstate -> dst_values [i ] = Float4GetDatum ((float )DatumGetFloat8 (fsstate -> src_values [i ]));
753753 } else {
@@ -1413,7 +1413,7 @@ postgresAcquireSampleRowsFunc(Relation relation, int elevel,
14131413 for (i = 0 ; i < tupdesc -> natts ; i ++ )
14141414 {
14151415 /* Ignore dropped columns. */
1416- if (tupdesc -> attrs [ i ] -> attisdropped )
1416+ if (TupleDescAttr ( tupdesc , i ) -> attisdropped )
14171417 continue ;
14181418 if (!first ) {
14191419 appendStringInfoString (& record , ", " );
@@ -1422,11 +1422,11 @@ postgresAcquireSampleRowsFunc(Relation relation, int elevel,
14221422 first = false;
14231423
14241424 /* Use attribute name or column_name option. */
1425- colname = NameStr (tupdesc -> attrs [ i ] -> attname );
1425+ colname = NameStr (TupleDescAttr ( tupdesc , i ) -> attname );
14261426 appendStringInfoString (& sql , "r." );
14271427 appendStringInfoString (& sql , quote_identifier (colname ));
14281428
1429- appendStringInfo (& record , "%s %s" , quote_identifier (colname ), deparse_type_name (tupdesc -> attrs [ i ] -> atttypid , tupdesc -> attrs [ i ] -> atttypmod ));
1429+ appendStringInfo (& record , "%s %s" , quote_identifier (colname ), deparse_type_name (TupleDescAttr ( tupdesc , i ) -> atttypid , TupleDescAttr ( tupdesc , i ) -> atttypmod ));
14301430 }
14311431 appendStringInfoString (& sql , " FROM " );
14321432 deparseRelation (& sql , relation );
0 commit comments