Commit dfd53f8a authored by Christoph Berg's avatar Christoph Berg

Dump locale environment variables if setlocale fails. (Closes: #848869)

parent 9ac67cc5
......@@ -2,6 +2,8 @@ postgresql-common (179) UNRELEASED; urgency=medium
* Catch all pg_ctl output by redirecting it to /var/log/postgresql.
(Closes: #830485)
* Dump locale environment variables if setlocale fails.
(Closes: #848869)
* Set default log_line_prefix to '%m [%p] %q%u@%d ' to match upstream
moving to '%m [%p] ' in PostgreSQL 10.
* Import new apt.postgresql.org key.
......
......@@ -229,7 +229,10 @@ exit 1 unless GetOptions ('u|user=s' => \$owneruid, 'g|group=s' => \$ownergid,
# check validity of locale
unless (setlocale (LC_ALL, "")) {
error ('The locale requested by the environment is invalid.')
my $env = join "\n",
map { " $_: $ENV{$_}" }
grep { /^(LC_|LANG)/ } sort keys %ENV;
error ("The locale requested by the environment is invalid:\n$env")
}
if (@ARGV < 2) {
......
......@@ -21,7 +21,7 @@
use strict;
use warnings;
use Getopt::Long;
use POSIX qw/setsid dup2 setlocale LC_ALL :sys_wait_h/;
use POSIX qw/setsid dup2 :sys_wait_h/;
use PgCommon;
use Fcntl qw(SEEK_SET O_RDWR O_CREAT O_EXCL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment