@@ -1328,8 +1328,8 @@ describeOneTableDetails(const char *schemaname,
1328
1328
appendPQExpBuffer (& buf , ",\n NULL AS indexdef" );
1329
1329
if (tableinfo .relkind == 'f' && pset .sversion >= 90200 )
1330
1330
appendPQExpBuffer (& buf , ",\n CASE WHEN attfdwoptions IS NULL THEN '' ELSE "
1331
- " '(' || array_to_string(ARRAY(SELECT quote_ident(option_name) || ' ' || quote_literal(option_value) FROM "
1332
- " pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1331
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT pg_catalog. quote_ident(option_name) || ' ' || pg_catalog. quote_literal(option_value) FROM "
1332
+ " pg_catalog. pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1333
1333
else
1334
1334
appendPQExpBuffer (& buf , ",\n NULL AS attfdwoptions" );
1335
1335
if (verbose )
@@ -1669,7 +1669,7 @@ describeOneTableDetails(const char *schemaname,
1669
1669
"\n a.attnum=d.refobjsubid)"
1670
1670
"\nWHERE d.classid='pg_catalog.pg_class'::pg_catalog.regclass"
1671
1671
"\n AND d.refclassid='pg_catalog.pg_class'::pg_catalog.regclass"
1672
- "\n AND d.objid=%s "
1672
+ "\n AND d.objid='%s' "
1673
1673
"\n AND d.deptype='a'" ,
1674
1674
oid );
1675
1675
@@ -2163,13 +2163,13 @@ describeOneTableDetails(const char *schemaname,
2163
2163
/* Footer information about foreign table */
2164
2164
printfPQExpBuffer (& buf ,
2165
2165
"SELECT s.srvname,\n"
2166
- " array_to_string(ARRAY(SELECT "
2167
- " quote_ident(option_name) || ' ' || "
2168
- " quote_literal(option_value) FROM "
2169
- " pg_options_to_table(ftoptions)), ', ') "
2166
+ " pg_catalog. array_to_string(ARRAY(\n "
2167
+ " SELECT pg_catalog. quote_ident(option_name)"
2168
+ " || ' ' || pg_catalog. quote_literal(option_value)\n "
2169
+ " FROM pg_catalog. pg_options_to_table(ftoptions)), ', ')\n "
2170
2170
"FROM pg_catalog.pg_foreign_table f,\n"
2171
2171
" pg_catalog.pg_foreign_server s\n"
2172
- "WHERE f.ftrelid = %s AND s.oid = f.ftserver;" ,
2172
+ "WHERE f.ftrelid = '%s' AND s.oid = f.ftserver;" ,
2173
2173
oid );
2174
2174
result = PSQLexec (buf .data , false);
2175
2175
if (!result )
@@ -2575,16 +2575,16 @@ listDbRoleSettings(const char *pattern, const char *pattern2)
2575
2575
2576
2576
printfPQExpBuffer (& buf , "SELECT rolname AS \"%s\", datname AS \"%s\",\n"
2577
2577
"pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
2578
- "FROM pg_db_role_setting AS s\n"
2579
- "LEFT JOIN pg_database ON pg_database .oid = setdatabase\n"
2580
- "LEFT JOIN pg_roles ON pg_roles .oid = setrole\n" ,
2578
+ "FROM pg_catalog. pg_db_role_setting s\n"
2579
+ "LEFT JOIN pg_catalog. pg_database d ON d .oid = setdatabase\n"
2580
+ "LEFT JOIN pg_catalog. pg_roles r ON r .oid = setrole\n" ,
2581
2581
gettext_noop ("Role" ),
2582
2582
gettext_noop ("Database" ),
2583
2583
gettext_noop ("Settings" ));
2584
2584
havewhere = processSQLNamePattern (pset .db , & buf , pattern , false, false,
2585
- NULL , "pg_roles .rolname" , NULL , NULL );
2585
+ NULL , "r .rolname" , NULL , NULL );
2586
2586
processSQLNamePattern (pset .db , & buf , pattern2 , havewhere , false,
2587
- NULL , "pg_database .datname" , NULL , NULL );
2587
+ NULL , "d .datname" , NULL , NULL );
2588
2588
appendPQExpBufferStr (& buf , "ORDER BY 1, 2;" );
2589
2589
}
2590
2590
else
@@ -2812,13 +2812,13 @@ listLanguages(const char *pattern, bool verbose, bool showSystem)
2812
2812
{
2813
2813
appendPQExpBuffer (& buf ,
2814
2814
",\n NOT l.lanispl AS \"%s\",\n"
2815
- " l.lanplcallfoid::regprocedure AS \"%s\",\n"
2816
- " l.lanvalidator::regprocedure AS \"%s\",\n " ,
2815
+ " l.lanplcallfoid::pg_catalog. regprocedure AS \"%s\",\n"
2816
+ " l.lanvalidator::pg_catalog. regprocedure AS \"%s\",\n " ,
2817
2817
gettext_noop ("Internal Language" ),
2818
2818
gettext_noop ("Call Handler" ),
2819
2819
gettext_noop ("Validator" ));
2820
2820
if (pset .sversion >= 90000 )
2821
- appendPQExpBuffer (& buf , "l.laninline::regprocedure AS \"%s\",\n " ,
2821
+ appendPQExpBuffer (& buf , "l.laninline::pg_catalog. regprocedure AS \"%s\",\n " ,
2822
2822
gettext_noop ("Inline Handler" ));
2823
2823
printACLColumn (& buf , "l.lanacl" );
2824
2824
}
@@ -3937,10 +3937,10 @@ listForeignDataWrappers(const char *pattern, bool verbose)
3937
3937
printACLColumn (& buf , "fdwacl" );
3938
3938
appendPQExpBuffer (& buf ,
3939
3939
",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
3940
- " '(' || array_to_string(ARRAY(SELECT "
3941
- " quote_ident(option_name) || ' ' || "
3942
- " quote_literal(option_value) FROM "
3943
- " pg_options_to_table(fdwoptions)), ', ') || ')' "
3940
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
3941
+ " pg_catalog. quote_ident(option_name) || ' ' || "
3942
+ " pg_catalog. quote_literal(option_value) FROM "
3943
+ " pg_catalog. pg_options_to_table(fdwoptions)), ', ') || ')' "
3944
3944
" END AS \"%s\"" ,
3945
3945
gettext_noop ("FDW Options" ));
3946
3946
@@ -4018,10 +4018,10 @@ listForeignServers(const char *pattern, bool verbose)
4018
4018
" s.srvtype AS \"%s\",\n"
4019
4019
" s.srvversion AS \"%s\",\n"
4020
4020
" CASE WHEN srvoptions IS NULL THEN '' ELSE "
4021
- " '(' || array_to_string(ARRAY(SELECT "
4022
- " quote_ident(option_name) || ' ' || "
4023
- " quote_literal(option_value) FROM "
4024
- " pg_options_to_table(srvoptions)), ', ') || ')' "
4021
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4022
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4023
+ " pg_catalog. quote_literal(option_value) FROM "
4024
+ " pg_catalog. pg_options_to_table(srvoptions)), ', ') || ')' "
4025
4025
" END AS \"%s\",\n"
4026
4026
" d.description AS \"%s\"" ,
4027
4027
gettext_noop ("Type" ),
@@ -4036,7 +4036,7 @@ listForeignServers(const char *pattern, bool verbose)
4036
4036
4037
4037
if (verbose )
4038
4038
appendPQExpBuffer (& buf ,
4039
- "LEFT JOIN pg_description d\n "
4039
+ "LEFT JOIN pg_catalog. pg_description d\n "
4040
4040
"ON d.classoid = s.tableoid AND d.objoid = s.oid "
4041
4041
"AND d.objsubid = 0\n" );
4042
4042
@@ -4092,10 +4092,10 @@ listUserMappings(const char *pattern, bool verbose)
4092
4092
if (verbose )
4093
4093
appendPQExpBuffer (& buf ,
4094
4094
",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
4095
- " '(' || array_to_string(ARRAY(SELECT "
4096
- " quote_ident(option_name) || ' ' || "
4097
- " quote_literal(option_value) FROM "
4098
- " pg_options_to_table(umoptions)), ', ') || ')' "
4095
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4096
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4097
+ " pg_catalog. quote_literal(option_value) FROM "
4098
+ " pg_catalog. pg_options_to_table(umoptions)), ', ') || ')' "
4099
4099
" END AS \"%s\"" ,
4100
4100
gettext_noop ("FDW Options" ));
4101
4101
@@ -4155,10 +4155,10 @@ listForeignTables(const char *pattern, bool verbose)
4155
4155
if (verbose )
4156
4156
appendPQExpBuffer (& buf ,
4157
4157
",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
4158
- " '(' || array_to_string(ARRAY(SELECT "
4159
- " quote_ident(option_name) || ' ' || "
4160
- " quote_literal(option_value) FROM "
4161
- " pg_options_to_table(ftoptions)), ', ') || ')' "
4158
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4159
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4160
+ " pg_catalog. quote_literal(option_value) FROM "
4161
+ " pg_catalog. pg_options_to_table(ftoptions)), ', ') || ')' "
4162
4162
" END AS \"%s\",\n"
4163
4163
" d.description AS \"%s\"" ,
4164
4164
gettext_noop ("FDW Options" ),
0 commit comments