@@ -1372,8 +1372,8 @@ describeOneTableDetails(const char *schemaname,
1372
1372
appendPQExpBufferStr (& buf , ",\n NULL AS indexdef" );
1373
1373
if (tableinfo .relkind == 'f' && pset .sversion >= 90200 )
1374
1374
appendPQExpBufferStr (& buf , ",\n CASE WHEN attfdwoptions IS NULL THEN '' ELSE "
1375
- " '(' || array_to_string(ARRAY(SELECT quote_ident(option_name) || ' ' || quote_literal(option_value) FROM "
1376
- " pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1375
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT pg_catalog. quote_ident(option_name) || ' ' || pg_catalog. quote_literal(option_value) FROM "
1376
+ " pg_catalog. pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1377
1377
else
1378
1378
appendPQExpBufferStr (& buf , ",\n NULL AS attfdwoptions" );
1379
1379
if (verbose )
@@ -1723,7 +1723,7 @@ describeOneTableDetails(const char *schemaname,
1723
1723
"\n a.attnum=d.refobjsubid)"
1724
1724
"\nWHERE d.classid='pg_catalog.pg_class'::pg_catalog.regclass"
1725
1725
"\n AND d.refclassid='pg_catalog.pg_class'::pg_catalog.regclass"
1726
- "\n AND d.objid=%s "
1726
+ "\n AND d.objid='%s' "
1727
1727
"\n AND d.deptype='a'" ,
1728
1728
oid );
1729
1729
@@ -2242,13 +2242,13 @@ describeOneTableDetails(const char *schemaname,
2242
2242
/* Footer information about foreign table */
2243
2243
printfPQExpBuffer (& buf ,
2244
2244
"SELECT s.srvname,\n"
2245
- " array_to_string(ARRAY(SELECT "
2246
- " quote_ident(option_name) || ' ' || "
2247
- " quote_literal(option_value) FROM "
2248
- " pg_options_to_table(ftoptions)), ', ') "
2245
+ " pg_catalog. array_to_string(ARRAY(\n "
2246
+ " SELECT pg_catalog. quote_ident(option_name)"
2247
+ " || ' ' || pg_catalog. quote_literal(option_value)\n "
2248
+ " FROM pg_catalog. pg_options_to_table(ftoptions)), ', ')\n "
2249
2249
"FROM pg_catalog.pg_foreign_table f,\n"
2250
2250
" pg_catalog.pg_foreign_server s\n"
2251
- "WHERE f.ftrelid = %s AND s.oid = f.ftserver;" ,
2251
+ "WHERE f.ftrelid = '%s' AND s.oid = f.ftserver;" ,
2252
2252
oid );
2253
2253
result = PSQLexec (buf .data , false);
2254
2254
if (!result )
@@ -2668,16 +2668,16 @@ listDbRoleSettings(const char *pattern, const char *pattern2)
2668
2668
2669
2669
printfPQExpBuffer (& buf , "SELECT rolname AS \"%s\", datname AS \"%s\",\n"
2670
2670
"pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
2671
- "FROM pg_db_role_setting AS s\n"
2672
- "LEFT JOIN pg_database ON pg_database .oid = setdatabase\n"
2673
- "LEFT JOIN pg_roles ON pg_roles .oid = setrole\n" ,
2671
+ "FROM pg_catalog. pg_db_role_setting s\n"
2672
+ "LEFT JOIN pg_catalog. pg_database d ON d .oid = setdatabase\n"
2673
+ "LEFT JOIN pg_catalog. pg_roles r ON r .oid = setrole\n" ,
2674
2674
gettext_noop ("Role" ),
2675
2675
gettext_noop ("Database" ),
2676
2676
gettext_noop ("Settings" ));
2677
2677
havewhere = processSQLNamePattern (pset .db , & buf , pattern , false, false,
2678
- NULL , "pg_roles .rolname" , NULL , NULL );
2678
+ NULL , "r .rolname" , NULL , NULL );
2679
2679
processSQLNamePattern (pset .db , & buf , pattern2 , havewhere , false,
2680
- NULL , "pg_database .datname" , NULL , NULL );
2680
+ NULL , "d .datname" , NULL , NULL );
2681
2681
appendPQExpBufferStr (& buf , "ORDER BY 1, 2;" );
2682
2682
}
2683
2683
else
@@ -2906,13 +2906,13 @@ listLanguages(const char *pattern, bool verbose, bool showSystem)
2906
2906
{
2907
2907
appendPQExpBuffer (& buf ,
2908
2908
",\n NOT l.lanispl AS \"%s\",\n"
2909
- " l.lanplcallfoid::regprocedure AS \"%s\",\n"
2910
- " l.lanvalidator::regprocedure AS \"%s\",\n " ,
2909
+ " l.lanplcallfoid::pg_catalog. regprocedure AS \"%s\",\n"
2910
+ " l.lanvalidator::pg_catalog. regprocedure AS \"%s\",\n " ,
2911
2911
gettext_noop ("Internal Language" ),
2912
2912
gettext_noop ("Call Handler" ),
2913
2913
gettext_noop ("Validator" ));
2914
2914
if (pset .sversion >= 90000 )
2915
- appendPQExpBuffer (& buf , "l.laninline::regprocedure AS \"%s\",\n " ,
2915
+ appendPQExpBuffer (& buf , "l.laninline::pg_catalog. regprocedure AS \"%s\",\n " ,
2916
2916
gettext_noop ("Inline Handler" ));
2917
2917
printACLColumn (& buf , "l.lanacl" );
2918
2918
}
@@ -4037,10 +4037,10 @@ listForeignDataWrappers(const char *pattern, bool verbose)
4037
4037
printACLColumn (& buf , "fdwacl" );
4038
4038
appendPQExpBuffer (& buf ,
4039
4039
",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
4040
- " '(' || array_to_string(ARRAY(SELECT "
4041
- " quote_ident(option_name) || ' ' || "
4042
- " quote_literal(option_value) FROM "
4043
- " pg_options_to_table(fdwoptions)), ', ') || ')' "
4040
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4041
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4042
+ " pg_catalog. quote_literal(option_value) FROM "
4043
+ " pg_catalog. pg_options_to_table(fdwoptions)), ', ') || ')' "
4044
4044
" END AS \"%s\"" ,
4045
4045
gettext_noop ("FDW Options" ));
4046
4046
@@ -4118,10 +4118,10 @@ listForeignServers(const char *pattern, bool verbose)
4118
4118
" s.srvtype AS \"%s\",\n"
4119
4119
" s.srvversion AS \"%s\",\n"
4120
4120
" CASE WHEN srvoptions IS NULL THEN '' ELSE "
4121
- " '(' || array_to_string(ARRAY(SELECT "
4122
- " quote_ident(option_name) || ' ' || "
4123
- " quote_literal(option_value) FROM "
4124
- " pg_options_to_table(srvoptions)), ', ') || ')' "
4121
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4122
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4123
+ " pg_catalog. quote_literal(option_value) FROM "
4124
+ " pg_catalog. pg_options_to_table(srvoptions)), ', ') || ')' "
4125
4125
" END AS \"%s\",\n"
4126
4126
" d.description AS \"%s\"" ,
4127
4127
gettext_noop ("Type" ),
@@ -4136,7 +4136,7 @@ listForeignServers(const char *pattern, bool verbose)
4136
4136
4137
4137
if (verbose )
4138
4138
appendPQExpBufferStr (& buf ,
4139
- "LEFT JOIN pg_description d\n "
4139
+ "LEFT JOIN pg_catalog. pg_description d\n "
4140
4140
"ON d.classoid = s.tableoid AND d.objoid = s.oid "
4141
4141
"AND d.objsubid = 0\n" );
4142
4142
@@ -4192,10 +4192,10 @@ listUserMappings(const char *pattern, bool verbose)
4192
4192
if (verbose )
4193
4193
appendPQExpBuffer (& buf ,
4194
4194
",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
4195
- " '(' || array_to_string(ARRAY(SELECT "
4196
- " quote_ident(option_name) || ' ' || "
4197
- " quote_literal(option_value) FROM "
4198
- " pg_options_to_table(umoptions)), ', ') || ')' "
4195
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4196
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4197
+ " pg_catalog. quote_literal(option_value) FROM "
4198
+ " pg_catalog. pg_options_to_table(umoptions)), ', ') || ')' "
4199
4199
" END AS \"%s\"" ,
4200
4200
gettext_noop ("FDW Options" ));
4201
4201
@@ -4255,10 +4255,10 @@ listForeignTables(const char *pattern, bool verbose)
4255
4255
if (verbose )
4256
4256
appendPQExpBuffer (& buf ,
4257
4257
",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
4258
- " '(' || array_to_string(ARRAY(SELECT "
4259
- " quote_ident(option_name) || ' ' || "
4260
- " quote_literal(option_value) FROM "
4261
- " pg_options_to_table(ftoptions)), ', ') || ')' "
4258
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4259
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4260
+ " pg_catalog. quote_literal(option_value) FROM "
4261
+ " pg_catalog. pg_options_to_table(ftoptions)), ', ') || ')' "
4262
4262
" END AS \"%s\",\n"
4263
4263
" d.description AS \"%s\"" ,
4264
4264
gettext_noop ("FDW Options" ),
0 commit comments