From: Robert Haas Date: Thu, 25 Aug 2011 16:37:32 +0000 (-0400) Subject: Properly quote SQL/MED generic options in pg_dump output. X-Git-Tag: REL9_0_5~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7cd5c836ae952b5911eac9ec5f888779a2d0b81;p=thirdparty%2Fpostgresql.git Properly quote SQL/MED generic options in pg_dump output. Shigeru Hanada --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 8721e6573db..d6a547fc475 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -5884,7 +5884,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); @@ -5969,7 +5970,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); @@ -10275,7 +10277,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);