Re: initdb ignores invalid locale names - Mailing list pgsql-hackers

From Tom Lane
Subject Re: initdb ignores invalid locale names
Date
Msg-id 9676.1158952730@sss.pgh.pa.us
Whole thread Raw
In response to initdb ignores invalid locale names  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> When initdb is given an invalid (possibly mistyped) locale name, it just 
> prints a warning and proceeds with the default locale from the 
> environment.  Someone already wondered about this before:

>     /* should we exit here? */
>     if (!ret)
>         fprintf(stderr, _("%s: invalid locale name \"%s\"\n"), progname,
>                 locale);

> I obviously think we should.  Why shouldn't we?

That would make it impossible to install at all on a machine with broken
locale support, which seems a bit of an overreaction, especially for the
noncritical locale items like LC_MESSAGES (which also happens to be the
one that fails most often).  I could go with erroring for LC_COLLATE and
LC_CTYPE, but I'd prefer to see us fall back to "C" for any of the other
LC_ items that fail.  Those guys are easy to fix after the fact, if the
user cares enough (or at all).

BTW, it would also be a good idea if the message specified which LC_
item we failed to set.
        regards, tom lane


pgsql-hackers by date:

Previous
From: AgentM
Date:
Subject: Re: Fwd: Is the fsync() fake on FreeBSD6.1?
Next
From: Tom Lane
Date:
Subject: Re: advisory locks and permissions