From 07123dff778389382f08d2152742bb061d351c21 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 10 Jan 2012 20:58:16 +0200 Subject: [PATCH] pg_dump: Dump foreign options in sorted order --- src/bin/pg_dump/pg_dump.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index d1598ea4e9..13fc667b78 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -5733,7 +5733,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables) "pg_catalog.array_to_string(ARRAY(" "SELECT pg_catalog.quote_ident(option_name) || " "' ' || pg_catalog.quote_literal(option_value) " - "FROM pg_catalog.pg_options_to_table(attfdwoptions)" + "FROM pg_catalog.pg_options_to_table(attfdwoptions) " + "ORDER BY option_name" "), E',\n ') AS attfdwoptions " "FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t " "ON a.atttypid = t.oid " @@ -6564,7 +6565,8 @@ getForeignDataWrappers(int *numForeignDataWrappers) "array_to_string(ARRAY(" "SELECT quote_ident(option_name) || ' ' || " "quote_literal(option_value) " - "FROM pg_options_to_table(fdwoptions)" + "FROM pg_options_to_table(fdwoptions) " + "ORDER BY option_name" "), E',\n ') AS fdwoptions " "FROM pg_foreign_data_wrapper", username_subquery); @@ -6578,7 +6580,8 @@ getForeignDataWrappers(int *numForeignDataWrappers) "array_to_string(ARRAY(" "SELECT quote_ident(option_name) || ' ' || " "quote_literal(option_value) " - "FROM pg_options_to_table(fdwoptions)" + "FROM pg_options_to_table(fdwoptions) " + "ORDER BY option_name" "), E',\n ') AS fdwoptions " "FROM pg_foreign_data_wrapper", username_subquery); @@ -6667,7 +6670,8 @@ getForeignServers(int *numForeignServers) "array_to_string(ARRAY(" "SELECT quote_ident(option_name) || ' ' || " "quote_literal(option_value) " - "FROM pg_options_to_table(srvoptions)" + "FROM pg_options_to_table(srvoptions) " + "ORDER BY option_name" "), E',\n ') AS srvoptions " "FROM pg_foreign_server", username_subquery); @@ -11777,7 +11781,8 @@ dumpUserMappings(Archive *fout, "array_to_string(ARRAY(" "SELECT quote_ident(option_name) || ' ' || " "quote_literal(option_value) " - "FROM pg_options_to_table(umoptions)" + "FROM pg_options_to_table(umoptions) " + "ORDER BY option_name" "), E',\n ') AS umoptions " "FROM pg_user_mappings " "WHERE srvid = '%u' " @@ -12438,7 +12443,8 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) "pg_catalog.array_to_string(ARRAY(" "SELECT pg_catalog.quote_ident(option_name) || " "' ' || pg_catalog.quote_literal(option_value) " - "FROM pg_catalog.pg_options_to_table(ftoptions)" + "FROM pg_catalog.pg_options_to_table(ftoptions) " + "ORDER BY option_name" "), E',\n ') AS ftoptions " "FROM pg_catalog.pg_foreign_table ft " "JOIN pg_catalog.pg_foreign_server fs " -- 2.40.0