diff --git a/cmd/brew-postgresql-upgrade-database.rb b/cmd/brew-postgresql-upgrade-database.rb index 8e2c0bf1248..c9ebd8ceb10 100755 --- a/cmd/brew-postgresql-upgrade-database.rb +++ b/cmd/brew-postgresql-upgrade-database.rb @@ -64,8 +64,8 @@ begin sql_for_lc_collate = "SELECT setting FROM pg_settings WHERE name LIKE 'lc_collate';" sql_for_lc_ctype = "SELECT setting FROM pg_settings WHERE name LIKE 'lc_ctype';" - lc_collate = Utils.popen_read("#{old_bin}/psql", "postgres", "-qtAX", "-U", ENV["USER"], "-c", sql_for_lc_collate) - lc_ctype = Utils.popen_read("#{old_bin}/psql", "postgres", "-qtAX", "-U", ENV["USER"], "-c", sql_for_lc_ctype) + lc_collate = Utils.popen_read("#{old_bin}/psql", "postgres", "-qtAX", "-U", ENV["USER"], "-c", sql_for_lc_collate).strip + lc_ctype = Utils.popen_read("#{old_bin}/psql", "postgres", "-qtAX", "-U", ENV["USER"], "-c", sql_for_lc_ctype).strip initdb_args = [] initdb_args += ["--lc-collate", lc_collate] unless lc_collate.empty? initdb_args += ["--lc-ctype", lc_ctype] unless lc_ctype.empty?