@@ -908,8 +908,8 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
908908
909909 if (i > 0 )
910910 appendStringInfoString (& buf , ", " );
911- attname = get_relid_attribute_name (trigrec -> tgrelid ,
912- trigrec -> tgattr .values [i ]);
911+ attname = get_attname (trigrec -> tgrelid ,
912+ trigrec -> tgattr .values [i ], false );
913913 appendStringInfoString (& buf , quote_identifier (attname ));
914914 }
915915 }
@@ -1292,7 +1292,7 @@ pg_get_indexdef_worker(Oid indexrelid, int colno,
12921292 char * attname ;
12931293 int32 keycoltypmod ;
12941294
1295- attname = get_relid_attribute_name (indrelid , attnum );
1295+ attname = get_attname (indrelid , attnum , false );
12961296 if (!colno || colno == keyno + 1 )
12971297 appendStringInfoString (& buf , quote_identifier (attname ));
12981298 get_atttypetypmodcoll (indrelid , attnum ,
@@ -1535,7 +1535,7 @@ pg_get_statisticsobj_worker(Oid statextid, bool missing_ok)
15351535 if (colno > 0 )
15361536 appendStringInfoString (& buf , ", " );
15371537
1538- attname = get_relid_attribute_name (statextrec -> stxrelid , attnum );
1538+ attname = get_attname (statextrec -> stxrelid , attnum , false );
15391539
15401540 appendStringInfoString (& buf , quote_identifier (attname ));
15411541 }
@@ -1692,7 +1692,7 @@ pg_get_partkeydef_worker(Oid relid, int prettyFlags,
16921692 char * attname ;
16931693 int32 keycoltypmod ;
16941694
1695- attname = get_relid_attribute_name (relid , attnum );
1695+ attname = get_attname (relid , attnum , false );
16961696 appendStringInfoString (& buf , quote_identifier (attname ));
16971697 get_atttypetypmodcoll (relid , attnum ,
16981698 & keycoltype , & keycoltypmod ,
@@ -2196,7 +2196,7 @@ decompile_column_index_array(Datum column_index_array, Oid relId,
21962196 {
21972197 char * colName ;
21982198
2199- colName = get_relid_attribute_name (relId , DatumGetInt16 (keys [j ]));
2199+ colName = get_attname (relId , DatumGetInt16 (keys [j ]), false );
22002200
22012201 if (j == 0 )
22022202 appendStringInfoString (buf , quote_identifier (colName ));
@@ -6015,8 +6015,9 @@ get_insert_query_def(Query *query, deparse_context *context)
60156015 * tle->resname, since resname will fail to track RENAME.
60166016 */
60176017 appendStringInfoString (buf ,
6018- quote_identifier (get_relid_attribute_name (rte -> relid ,
6019- tle -> resno )));
6018+ quote_identifier (get_attname (rte -> relid ,
6019+ tle -> resno ,
6020+ false)));
60206021
60216022 /*
60226023 * Print any indirection needed (subfields or subscripts), and strip
@@ -6319,8 +6320,9 @@ get_update_query_targetlist_def(Query *query, List *targetList,
63196320 * tle->resname, since resname will fail to track RENAME.
63206321 */
63216322 appendStringInfoString (buf ,
6322- quote_identifier (get_relid_attribute_name (rte -> relid ,
6323- tle -> resno )));
6323+ quote_identifier (get_attname (rte -> relid ,
6324+ tle -> resno ,
6325+ false)));
63246326
63256327 /*
63266328 * Print any indirection needed (subfields or subscripts), and strip
@@ -10340,8 +10342,8 @@ processIndirection(Node *node, deparse_context *context)
1034010342 * target lists, but this function cannot be used for that case.
1034110343 */
1034210344 Assert (list_length (fstore -> fieldnums ) == 1 );
10343- fieldname = get_relid_attribute_name (typrelid ,
10344- linitial_int (fstore -> fieldnums ));
10345+ fieldname = get_attname (typrelid ,
10346+ linitial_int (fstore -> fieldnums ), false );
1034510347 appendStringInfo (buf , ".%s" , quote_identifier (fieldname ));
1034610348
1034710349 /*
0 commit comments