@@ -1458,8 +1458,8 @@ describeOneTableDetails(const char *schemaname,
1458
1458
appendPQExpBufferStr (& buf , ",\n NULL AS indexdef" );
1459
1459
if (tableinfo .relkind == 'f' && pset .sversion >= 90200 )
1460
1460
appendPQExpBufferStr (& buf , ",\n CASE WHEN attfdwoptions IS NULL THEN '' ELSE "
1461
- " '(' || array_to_string(ARRAY(SELECT quote_ident(option_name) || ' ' || quote_literal(option_value) FROM "
1462
- " pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1461
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT pg_catalog. quote_ident(option_name) || ' ' || pg_catalog. quote_literal(option_value) FROM "
1462
+ " pg_catalog. pg_options_to_table(attfdwoptions)), ', ') || ')' END AS attfdwoptions" );
1463
1463
else
1464
1464
appendPQExpBufferStr (& buf , ",\n NULL AS attfdwoptions" );
1465
1465
if (verbose )
@@ -1809,7 +1809,7 @@ describeOneTableDetails(const char *schemaname,
1809
1809
"\n a.attnum=d.refobjsubid)"
1810
1810
"\nWHERE d.classid='pg_catalog.pg_class'::pg_catalog.regcla
8000
ss"
1811
1811
"\n AND d.refclassid='pg_catalog.pg_class'::pg_catalog.regclass"
1812
- "\n AND d.objid=%s "
1812
+ "\n AND d.objid='%s' "
1813
1813
"\n AND d.deptype='a'" ,
1814
1814
oid );
1815
1815
@@ -2043,7 +2043,7 @@ describeOneTableDetails(const char *schemaname,
2043
2043
{
2044
2044
printfPQExpBuffer (& buf ,
2045
2045
"SELECT pol.polname,\n"
2046
- "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"
2046
+ "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"
2047
2047
"pg_catalog.pg_get_expr(pol.polqual, pol.polrelid),\n"
2048
2048
"pg_catalog.pg_get_expr(pol.polwithcheck, pol.polrelid),\n"
2049
2049
"CASE pol.polcmd \n"
@@ -2403,13 +2403,13 @@ describeOneTableDetails(const char *schemaname,
2403
2403
/* Footer information about foreign table */
2404
2404
printfPQExpBuffer (& buf ,
2405
2405
"SELECT s.srvname,\n"
2406
- " array_to_string(ARRAY(SELECT "
2407
- " quote_ident(option_name) || ' ' || "
2408
- " quote_literal(option_value) FROM "
2409
- " pg_options_to_table(ftoptions)), ', ') "
2406
+ " pg_catalog. array_to_string(ARRAY(\n "
2407
+ " SELECT pg_catalog. quote_ident(option_name)"
2408
+ " || ' ' || pg_catalog. quote_literal(option_value)\n "
2409
+ " FROM pg_catalog. pg_options_to_table(ftoptions)), ', ')\n "
2410
2410
"FROM pg_catalog.pg_foreign_table f,\n"
2411
2411
" pg_catalog.pg_foreign_server s\n"
2412
- "WHERE f.ftrelid = %s AND s.oid = f.ftserver;" ,
2412
+ "WHERE f.ftrelid = '%s' AND s.oid = f.ftserver;" ,
2413
2413
oid );
2414
2414
result = PSQLexec (buf .data );
2415
2415
if (!result )
@@ -2837,16 +2837,16 @@ listDbRoleSettings(const char *pattern, const char *pattern2)
2837
2837
2838
2838
printfPQExpBuffer (& buf , "SELECT rolname AS \"%s\", datname AS \"%s\",\n"
2839
2839
"pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
2840
- "FROM pg_db_role_setting AS s\n"
2841
- "LEFT JOIN pg_database ON pg_database .oid = setdatabase\n"
2842
- "LEFT JOIN pg_roles ON pg_roles .oid = setrole\n" ,
2840
+ "FROM pg_catalog. pg_db_role_setting s\n"
2841
+ "LEFT JOIN pg_catalog. pg_database d ON d .oid = setdatabase\n"
2842
+ "LEFT JOIN pg_catalog. pg_roles r ON r .oid = setrole\n" ,
2843
2843
gettext_noop ("Role" ),
2844
2844
gettext_noop ("Database" ),
2845
2845
gettext_noop ("Settings" ));
2846
2846
havewhere = processSQLNamePattern (pset .db , & buf , pattern , false, false,
2847
- NULL , "pg_roles .rolname" , NULL , NULL );
2847
+ NULL , "r .rolname" , NULL , NULL );
2848
2848
processSQLNamePattern (pset .db , & buf , pattern2 , havewhere , false,
2849
- NULL , "pg_database .datname" , NULL , NULL );
2849
+ NULL , "d .datname" , NULL , NULL );
2850
2850
appendPQExpBufferStr (& buf , "ORDER BY 1, 2;" );
2851
2851
}
2852
2852
else
@@ -3075,13 +3075,13 @@ listLanguages(const char *pattern, bool verbose, bool showSystem)
3075
3075
{
3076
3076
appendPQExpBuffer (& buf ,
3077
3077
",\n NOT l.lanispl AS \"%s\",\n"
3078
- " l.lanplcallfoid::regprocedure AS \"%s\",\n"
3079
- " l.lanvalidator::regprocedure AS \"%s\",\n " ,
3078
+ " l.lanplcallfoid::pg_catalog. regprocedure AS \"%s\",\n"
3079
+ " l.lanvalidator::pg_catalog. regprocedure AS \"%s\",\n " ,
3080
3080
gettext_noop ("Internal Language" ),
3081
3081
gettext_noop ("Call Handler" ),
3082
3082
gettext_noop ("Validator" ));
3083
3083
if (pset .sversion >= 90000 )
3084
- appendPQExpBuffer (& buf , "l.laninline::regprocedure AS \"%s\",\n " ,
3084
+ appendPQExpBuffer (& buf , "l.laninline::pg_catalog. regprocedure AS \"%s\",\n " ,
3085
3085
gettext_noop ("Inline Handler" ));
3086
3086
printACLColumn (& buf , "l.lanacl" );
3087
3087
}
@@ -4206,10 +4206,10 @@ listForeignDataWrappers(const char *pattern, bool verbose)
4206
4206
printACLColumn (& buf , "fdwacl" );
4207
4207
appendPQExpBuffer (& buf ,
4208
4208
",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
4209
- " '(' || array_to_string(ARRAY(SELECT "
4210
- " quote_ident(option_name) || ' ' || "
4211
- " quote_literal(option_value) FROM "
4212
- " pg_options_to_table(fdwoptions)), ', ') || ')' "
4209
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4210
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4211
+ " pg_catalog. quote_literal(option_value) FROM "
4212
+ " pg_catalog. pg_options_to_table(fdwoptions)), ', ') || ')' "
4213
4213
" END AS \"%s\"" ,
4214
4214
gettext_noop ("FDW Options" ));
4215
4215
@@ -4287,10 +4287,10 @@ listForeignServers(const char *pattern, bool verbose)
4287
4287
" s.srvtype AS \"%s\",\n"
4288
4288
" s.srvversion AS \"%s\",\n"
4289
4289
" CASE WHEN srvoptions IS NULL THEN '' ELSE "
4290
- " '(' || array_to_string(ARRAY(SELECT "
4291
- " quote_ident(option_name) || ' ' || "
4292
- " quote_literal(option_value) FROM "
4293
- " pg_options_to_table(srvoptions)), ', ') || ')' "
4290
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4291
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4292
+ " pg_catalog. quote_literal(option_value) FROM "
4293
+ " pg_catalog. pg_options_to_table(srvoptions)), ', ') || ')' "
4294
4294
" END AS \"%s\",\n"
4295
4295
" d.description AS \"%s\"" ,
4296
4296
gettext_noop ("Type" ),
@@ -4305,7 +4305,7 @@ listForeignServers(const char *pattern, bool verbose)
4305
4305
4306
4306
if (verbose )
4307
4307
appendPQExpBufferStr (& buf ,
4308
- "LEFT JOIN pg_description d\n "
4308
+ "LEFT JOIN pg_catalog. pg_description d\n "
4309
4309
"ON d.classoid = s.tableoid AND d.objoid = s.oid "
4310
4310
"AND d.objsubid = 0\n" );
4311
4311
@@ -4361,10 +4361,10 @@ listUserMappings(const char *pattern, bool verbose)
4361
4361
if (verbose )
4362
4362
appendPQExpBuffer (& buf ,
4363
4363
",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
4364
- " '(' || array_to_string(ARRAY(SELECT "
4365
- " quote_ident(option_name) || ' ' || "
4366
- " quote_literal(option_value) FROM "
4367
- " pg_options_to_table(umoptions)), ', ') || ')' "
4364
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4365
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4366
+ " pg_catalog. quote_literal(option_value) FROM "
4367
+ " pg_catalog. pg_options_to_table(umoptions)), ', ') || ')' "
4368
4368
" END AS \"%s\"" ,
4369
4369
gettext_noop ("FDW Options" ));
4370
4370
@@ -4424,10 +4424,10 @@ listForeignTables(const char *pattern, bool verbose)
4424
4424
if (verbose )
4425
4425
appendPQExpBuffer (& buf ,
4426
4426
",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
4427
- " '(' || array_to_string(ARRAY(SELECT "
4428
- " quote_ident(option_name) || ' ' || "
4429
- " quote_literal(option_value) FROM "
4430
- " pg_options_to_table(ftoptions)), ', ') || ')' "
4427
+ " '(' || pg_catalog. array_to_string(ARRAY(SELECT "
4428
+ " pg_catalog. quote_ident(option_name) || ' ' || "
4429
+ " pg_catalog. quote_literal(option_value) FROM "
4430
+ " pg_catalog. pg_options_to_table(ftoptions)), ', ') || ')' "
4431
4431
" END AS \"%s\",\n"
4432
4432
" d.description AS \"%s\"" ,
4433
4433
gettext_noop ("FDW Options" ),
0 commit comments