Properly quote SQL/MED generic options in pg_dump output.
Shigeru Hanada
This commit is contained in:
parent
e1f0820b0d
commit
de632180ed
@ -6369,7 +6369,8 @@ getForeignDataWrappers(int *numForeignDataWrappers)
|
||||
"fdwhandler::pg_catalog.regproc, "
|
||||
"fdwvalidator::pg_catalog.regproc, fdwacl, "
|
||||
"array_to_string(ARRAY("
|
||||
" SELECT option_name || ' ' || quote_literal(option_value) "
|
||||
" SELECT quote_ident(option_name) || ' ' || "
|
||||
" quote_literal(option_value) "
|
||||
" FROM pg_options_to_table(fdwoptions)), ', ') AS fdwoptions "
|
||||
"FROM pg_foreign_data_wrapper",
|
||||
username_subquery);
|
||||
@ -6381,7 +6382,8 @@ getForeignDataWrappers(int *numForeignDataWrappers)
|
||||
"'-' AS fdwhandler, "
|
||||
"fdwvalidator::pg_catalog.regproc, fdwacl, "
|
||||
"array_to_string(ARRAY("
|
||||
" SELECT option_name || ' ' || quote_literal(option_value) "
|
||||
" SELECT quote_ident(option_name) || ' ' || "
|
||||
" quote_literal(option_value) "
|
||||
" FROM pg_options_to_table(fdwoptions)), ', ') AS fdwoptions "
|
||||
"FROM pg_foreign_data_wrapper",
|
||||
username_subquery);
|
||||
@ -6468,7 +6470,8 @@ getForeignServers(int *numForeignServers)
|
||||
"(%s srvowner) AS rolname, "
|
||||
"srvfdw, srvtype, srvversion, srvacl,"
|
||||
"array_to_string(ARRAY("
|
||||
" SELECT option_name || ' ' || quote_literal(option_value) "
|
||||
" SELECT quote_ident(option_name) || ' ' || "
|
||||
" quote_literal(option_value) "
|
||||
" FROM pg_options_to_table(srvoptions)), ', ') AS srvoptions "
|
||||
"FROM pg_foreign_server",
|
||||
username_subquery);
|
||||
@ -11395,7 +11398,7 @@ dumpUserMappings(Archive *fout,
|
||||
|
||||
appendPQExpBuffer(query,
|
||||
"SELECT usename, "
|
||||
"array_to_string(ARRAY(SELECT option_name || ' ' || quote_literal(option_value) FROM pg_options_to_table(umoptions)), ', ') AS umoptions\n"
|
||||
"array_to_string(ARRAY(SELECT quote_ident(option_name) || ' ' || quote_literal(option_value) FROM pg_options_to_table(umoptions)), ', ') AS umoptions\n"
|
||||
"FROM pg_user_mappings "
|
||||
"WHERE srvid = %u",
|
||||
catalogId.oid);
|
||||
@ -12043,7 +12046,8 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
|
||||
/* retrieve name of foreign server and generic options */
|
||||
appendPQExpBuffer(query,
|
||||
"SELECT fs.srvname, array_to_string(ARRAY("
|
||||
" SELECT option_name || ' ' || quote_literal(option_value)"
|
||||
" SELECT quote_ident(option_name) || ' ' || "
|
||||
" quote_literal(option_value)"
|
||||
" FROM pg_options_to_table(ftoptions)), ', ') AS ftoptions "
|
||||
"FROM pg_foreign_table ft JOIN pg_foreign_server fs "
|
||||
" ON (fs.oid = ft.ftserver) "
|
||||
|
Loading…
x
Reference in New Issue
Block a user