pgsql: Make initdb throw error for bad locale values.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make initdb throw error for bad locale values.
Date: 2014-05-14 15:51:19
Message-ID: E1WkbSh-0000Pw-IZ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make initdb throw error for bad locale values.

Historically we've printed a complaint for a bad locale setting, but then
fallen back to the environment default. Per discussion, this is not such
a great idea, because rectifying an erroneous locale choice post-initdb
(perhaps long after data has been loaded) could be enormously expensive.
Better to complain and give the user a chance to double-check things.

The behavior was particularly bad if the bad setting came from environment
variables rather than a bogus command-line switch: in that case not only
was there a fallback to C/SQL_ASCII, but the printed complaint was quite
unhelpful. It's hard to be entirely sure what variables setlocale looked
at, but we can at least give a hint where the problem might be.

Per a complaint from Tomas Vondra.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/31a263237fa3eb6f36d58335fbdb82bab3136db3

Modified Files
--------------
src/bin/initdb/initdb.c | 86 ++++++++++++++++++++++++++---------------------
1 file changed, 47 insertions(+), 39 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2014-05-14 16:21:43 pgsql: doc: fix typo in 9.4 release note comments
Previous Message Bruce Momjian 2014-05-14 15:02:27 Re: pgsql: Replace SYSTEMQUOTEs with Windows-specific wrapper functions.