diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-08-25 12:37:32 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-08-25 12:38:22 -0400 |
commit | 636bff08f48fe83b7a103a281c71778ada1d49e0 (patch) | |
tree | 69ec1d3b1c9ffc7bb65435367d3ffe398f32db13 | |
parent | e99bb79e505f7af40376b7ee0ad8547b0e9ed370 (diff) | |
download | postgresql-636bff08f48fe83b7a103a281c71778ada1d49e0.tar.gz postgresql-636bff08f48fe83b7a103a281c71778ada1d49e0.zip |
Properly quote SQL/MED generic options in pg_dump output.
Shigeru Hanada
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index ccbc1d8b9e3..b00e19b8b6f 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -5473,7 +5473,8 @@ getForeignDataWrappers(int *numForeignDataWrappers) appendPQExpBuffer(query, "SELECT tableoid, oid, fdwname, " "(%s fdwowner) AS rolname, 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); @@ -5558,7 +5559,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); @@ -9576,7 +9578,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); |