@@ -1553,8 +1553,8 @@ describeOneTableDetails(const char *schemaname,
1553
1553
appendPQExpBufferStr (& buf , ",\n NULL AS indexdef" );
1554
1554
if (tableinfo .relkind == 'f' && pset .sversion >= 90200 )
1555
1555
appendPQExpBufferStr (& buf , ",\n CASE WHEN attfdwoptions IS NULL THEN '' ELSE "
1556
- " '(' || array_to_string(ARRAY(SELECT quote_ident(option_name) || ' ' || quote_literal(option_value) FROM "
1557
- " pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1556
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT pg_catalog. quote_ident(option_name) || ' ' || pg_catalog. quote_literal(option_value) FROM "
1557
+ " pg_catalog. pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1558
1558
else
1559
1559
appendPQExpBufferStr (& buf , ",\n NULL AS attfdwoptions" );
1560
1560
if (verbose )
@@ -1904,7 +1904,7 @@ describeOneTableDetails(const char *schemaname,
1904
1904
"\n a.attnum=d.refobjsubid)"
1905
1905
"\nWHERE d.classid='pg_catalog.pg_class'::pg_catalog.regclass"
1906
1906
"\n AND d.refclassid='pg_catalog.pg_class'::pg_catalog.regclass"
1907
- "\n AND d.objid=%s "
1907
+ "\n AND d.objid='%s' "
1908
1908
"\n AND d.deptype='a'" ,
1909
1909
oid );
1910
1910
@@ -2138,7 +2138,7 @@ describeOneTableDetails(const char *schemaname,
2138
2138
{
2139
2139
printfPQExpBuffer (& buf ,
2140
2140
"SELECT pol.polname,\n"
2141
- "CASE WHEN pol.polroles = '{0}' THEN NULL ELSE array_to_string(array(select rolname from pg_roles where oid = any (pol.polroles) order by 1),',') END,\n"
2141
+ "CASE WHEN pol.polroles = '{0}' THEN NULL ELSE pg_catalog. array_to_string(array(select rolname from pg_catalog. pg_roles where oid = any (pol.polroles) order by 1),',') END,\n"
2142
2142
"pg_catalog.pg_get_expr(pol.polqual, pol.polrelid),\n"
2143
2143
"pg_catalog.pg_get_expr(pol.polwithcheck, pol.polrelid),\n"
2144
2144
"CASE pol.polcmd \n"
@@ -2498,13 +2498,13 @@ describeOneTableDetails(const char *schemaname,
2498
2498
/* Footer information about foreign table */
2499
2499
printfPQExpBuffer (& buf ,
2500
2500
"SELECT s.srvname,\n"
2501
- " array_to_string(ARRAY(SELECT "
2502
- " quote_ident(option_name) || ' ' || "
2503
- " quote_literal(option_value) FROM "
2504
- " pg_options_to_table(ftoptions)), ', ') "
2501
+ " pg_catalog. array_to_string(ARRAY(\n "
2502
+ " SELECT pg_catalog. quote_ident(option_name)"
2503
+ " || ' ' || pg_catalog. quote_literal(option_value)\n "
2504
+ " FROM pg_catalog. pg_options_to_table(ftoptions)), ', ')\n "
2505
2505
"FROM pg_catalog.pg_foreign_table f,\n"
2506
2506
" pg_catalog.pg_foreign_server s\n"
2507
- "WHERE f.ftrelid = %s AND s.oid = f.ftserver;" ,
2507
+ "WHERE f.ftrelid = '%s' AND s.oid = f.ftserver;" ,
2508
2508
oid );
2509
2509
result = PSQLexec (buf .data );
2510
2510
if (!result )
@@ -2935,16 +2935,16 @@ listDbRoleSettings(const char *pattern, const char *pattern2)
2935
2935
2936
2936
printfPQExpBuffer (& buf , "SELECT rolname AS \"%s\", datname AS \"%s\",\n"
2937
2937
"pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
2938
- "FROM pg_db_role_setting AS s\n"
2939
- "LEFT JOIN pg_database ON pg_database .oid = setdatabase\n"
2940
- "LEFT JOIN pg_roles ON pg_roles .oid = setrole\n" ,
2938
+ "FROM pg_catalog. pg_db_role_setting s\n"
2939
+ "LEFT JOIN pg_catalog. pg_database d ON d .oid = setdatabase\n"
2940
+ "LEFT JOIN pg_catalog. pg_roles r ON r .oid = setrole\n" ,
2941
2941
gettext_noop ("Role" ),
2942
2942
gettext_noop ("Database" ),
2943
2943
gettext_noop ("Settings" ));
2944
2944
havewhere = processSQLNamePattern (pset .db , & buf , pattern , false, false,
2945
- NULL , "pg_roles .rolname" , NULL , NULL );
2945
+ NULL , "r .rolname" , NULL , NULL );
2946
2946
processSQLNamePattern (pset .db , & buf , pattern2 , havewhere , false,
2947
- NULL , "pg_database .datname" , NULL , NULL );
2947
+ NULL , "d .datname" , NULL , NULL );
2948
2948
appendPQExpBufferStr (& buf , "ORDER BY 1, 2;" );
2949
2949
}
2950
2950
else
@@ -3173,13 +3173,13 @@ listLanguages(const char *pattern, bool verbose, bool showSystem)
3173
3173
{
3174
3174
appendPQExpBuffer (& buf ,
3175
3175
",\n NOT l.lanispl AS \"%s\",\n"
3176
- " l.lanplcallfoid::regprocedure AS \"%s\",\n"
3177
- " l.lanvalidator::regprocedure AS \"%s\",\n " ,
3176
+ " l.lanplcallfoid::pg_catalog. regprocedure AS \"%s\",\n"
3177
+ " l.lanvalidator::pg_catalog. regprocedure AS \"%s\",\n " ,
3178
3178
gettext_noop ("Internal Language" ),
3179
3179
gettext_noop ("Call Handler" ),
3180
3180
gettext_noop ("Validator" ));
3181
3181
if (pset .sversion >= 90000 )
3182
- appendPQExpBuffer (& buf , "l.laninline::regprocedure AS \"%s\",\n " ,
3182
+ appendPQExpBuffer (& buf , "l.laninline::pg_catalog. regprocedure AS \"%s\",\n " ,
3183
3183
gettext_noop ("Inline Handler" ));
3184
3184
printACLColumn (& buf , "l.lanacl" );
3185
3185
}
@@ -4304,10 +4304,10 @@ listForeignDataWrappers(const char *pattern, bool verbose)
4304
4304
printACLColumn (& buf , "fdwacl" );
4305
4305
appendPQExpBuffer (& buf ,
4306
4306
",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
4307
- " '(' || array_to_string(ARRAY(SELECT "
4308
- " quote_ident(option_name) || ' ' || "
4309
- " quote_literal(option_value) FROM "
4310
- " pg_options_to_table(fdwoptions)), ', ') || ')' "
4307
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4308
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4309
+ " pg_catalog. quote_literal(option_value) FROM "
4310
+ " pg_catalog. pg_options_to_table(fdwoptions)), ', ') || ')' "
4311
4311
" END AS \"%s\"" ,
4312
4312
gettext_noop ("FDW Options" ));
4313
4313
@@ -4385,10 +4385,10 @@ listForeignServers(const char *pattern, bool verbose)
4385
4385
" s.srvtype AS \"%s\",\n"
4386
4386
" s.srvversion AS \"%s\",\n"
4387
4387
" CASE WHEN srvoptions IS NULL THEN '' ELSE "
4388
- " '(' || array_to_string(ARRAY(SELECT "
4389
- " quote_ident(option_name) || ' ' || "
4390
- " quote_literal(option_value) FROM "
4391
- " pg_options_to_table(srvoptions)), ', ') || ')' "
4388
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4389
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4390
+ " pg_catalog. quote_literal(option_value) FROM "
4391
+ " pg_catalog. pg_options_to_table(srvoptions)), ', ') || ')' "
4392
4392
" END AS \"%s\",\n"
4393
4393
" d.description AS \"%s\"" ,
4394
4394
gettext_noop ("Type" ),
@@ -4403,7 +4403,7 @@ listForeignServers(const char *pattern, bool verbose)
4403
4403
4404
4404
if (verbose )
4405
4405
appendPQExpBufferStr (& buf ,
4406
- "LEFT JOIN pg_description d\n "
4406
+ "LEFT JOIN pg_catalog. pg_description d\n "
4407
4407
"ON d.classoid = s.tableoid AND d.objoid = s.oid "
4408
4408
"AND d.objsubid = 0\n" );
4409
4409
@@ -4459,10 +4459,10 @@ listUserMappings(const char *pattern, bool verbose)
4459
4459
if (verbose )
4460
4460
appendPQExpBuffer (& buf ,
4461
4461
",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
4462
- " '(' || array_to_string(ARRAY(SELECT "
4463
- " quote_ident(option_name) || ' ' || "
4464
- " quote_literal(option_value) FROM "
4465
- " pg_options_to_table(umoptions)), ', ') || ')' "
4462
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4463
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4464
+ " pg_catalog. quote_literal(option_value) FROM "
4465
+ " pg_catalog. pg_options_to_table(umoptions)), ', ') || ')' "
4466
4466
" END AS \"%s\"" ,
4467
4467
gettext_noop ("FDW Options" ));
4468
4468
@@ -4522,10 +4522,10 @@ listForeignTables(const char *pattern, bool verbose)
4522
4522
if (verbose )
4523
4523
appendPQExpBuffer (& buf ,
4524
4524
",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
4525
- " '(' || array_to_string(ARRAY(SELECT "
4526
- " quote_ident(option_name) || ' ' || "
4527
- " quote_literal(option_value) FROM "
4528
- " pg_options_to_table(ftoptions)), ', ') || ')' "
4525
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4526
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4527
+ " pg_catalog. quote_literal(option_value) FROM "
4528
+ " pg_catalog. pg_options_to_table(ftoptions)), ', ') || ')' "
4529
4529
" END AS \"%s\",\n"
4530
4530
" d.description AS \"%s\"" ,
4531
4531
gettext_noop ("FDW Options" ),
0 commit comments