Thread: FATAL: invalid value for option 'LC_MESSAGES': 'en_US'

FATAL: invalid value for option 'LC_MESSAGES': 'en_US'

From
Frank Seesink
Date:
Alright, new issue...hope it's minor.

Installed Cygwin and PostgreSQL clean following my own instructions
posted to this list, but when I get to the step to fire up the
PostgreSQL engine itself via

    $ net start postmaster

I get the gloriously useless
    ____________________________________________________________
    The postmaster service is starting.
    The postmaster service could not be started.

    The service did not report an error.

    More help is available by typing NET HELPMSG 3534.
    ____________________________________________________________

And for anyone who has ever typed in "NET HELPMSG 3534", you know that
you end up with "The service did not report an error".

    Note this install is identical in every respect but one with the
install I did on my test box, which worked just great.  The one
difference is that I switched in the Cygwin1.dll nightly snapshot right
in the beginning of this install (so it was in place when I did
'initdb'), whereas in the initial install I only dropped that in AFTER
having trouble getting psql to connect via sockets.  However, I have
ruled that issue out by restoring the distribution cygwin1.dll,
resetting CygIPC, deleting the /usr/share/postgresql/data directory, and
then redoing the 'initdb' command to initialize the database (while
using the distribution version of cygwin1.dll), and in either case, I
end up with postmaster failing to start.

    As for the useless NET HELPMSG info, being the handy-dandy Windows guy
that I am (translation:  I have to deal with this crap regularly), I
checked the Application Event Log, where the error message gave me a
little more insight in that PostgreSQL claims it did not have privilege
to execute...though it was vague on what exactly.

    To be safe, I re-typed the password for the 'postgres' account in the
'postmaster' NT service, but no luck.

    I then checked /var/log/postmaster.log, which contained
    ____________________________________________________________
    FATAL:  invalid value for option 'LC_MESSAGES': 'en_US'
    ____________________________________________________________

More research led me to the file
    /usr/share/postgresql/data/postgresql.conf

at the end of which is just such a setting for LC_MESSAGES.  But that's
as far as I get.

    I'm still scratching my head as to why one box works just fine and the
other does not, and why this particular message.  Thoughts?  Ideas?

P.S.    Though once again, it should not play a part, I thought I better
         mention that this new PC is running 2 CPUs, whereas my test box
         only had 1.  Could this be an issue?  Is PostgreSQL sensitive
    to dual CPU boxes?


Re: FATAL: invalid value for option 'LC_MESSAGES': 'en_US'

From
Frank Seesink
Date:
    Never mind.  In short, yes it was a simple problem.

    Turns out that if you have an environment variable LANG set (e.g.,
LANG=en_US), this wreaks havoc when you run initdb.  I'm afraid I don't
know why (though I'll be digging into that).  But in short, my 2nd PC
had that variable set (due to an IBM PL/1 compiler installation on that
machine...looooong story) whereas the test PC did not.

    Standard Windows XP installs don't have this variable set, but just in
case you have a similar problem, it's an easy fix.

    Just before executing the 'initdb' command, do the following:

    $ set | more

and look to see if you have a LANG environment variable set.  Cygwin
will not have this by default, so it will have sucked it in from the
Windows environment table if it's there.  If so, simply type

    $ unset LANG

to unset it within that BASH session, then do your 'initdb' as usual.
Don't worry.  This has no long-lasting effects.  The only way to remove
that environment variable for good, you need to remove it from Windows
by RIGHT-clicking on 'My Computer' & clicking 'Properties' from the
popup, then navigating to the 'Advanced' tab,
[Environment Variables], highlighting the LANG environment variable
(most likely in System Variables) and clicking [Delete], then [Ok]ing
your way out.

    Anyway, problem solved.  Once initdb is run, this environment variable
doesn't seem to get in the way (but don't quote me on that).


Frank Seesink wrote:
> Alright, new issue...hope it's minor.
>
> Installed Cygwin and PostgreSQL clean following my own instructions
> posted to this list, but when I get to the step to fire up the
> PostgreSQL engine itself via
>
>     $ net start postmaster
>
> I get the gloriously useless
>     ____________________________________________________________
>     The postmaster service is starting.
>     The postmaster service could not be started.
>
>     The service did not report an error.
>
>     More help is available by typing NET HELPMSG 3534.
>     ____________________________________________________________
>
> And for anyone who has ever typed in "NET HELPMSG 3534", you know that
> you end up with "The service did not report an error".
>
>     Note this install is identical in every respect but one with the
> install I did on my test box, which worked just great.  The one
> difference is that I switched in the Cygwin1.dll nightly snapshot right
> in the beginning of this install (so it was in place when I did
> 'initdb'), whereas in the initial install I only dropped that in AFTER
> having trouble getting psql to connect via sockets.  However, I have
> ruled that issue out by restoring the distribution cygwin1.dll,
> resetting CygIPC, deleting the /usr/share/postgresql/data directory, and
> then redoing the 'initdb' command to initialize the database (while
> using the distribution version of cygwin1.dll), and in either case, I
> end up with postmaster failing to start.
>
>     As for the useless NET HELPMSG info, being the handy-dandy Windows
> guy that I am (translation:  I have to deal with this crap regularly), I
> checked the Application Event Log, where the error message gave me a
> little more insight in that PostgreSQL claims it did not have privilege
> to execute...though it was vague on what exactly.
>
>     To be safe, I re-typed the password for the 'postgres' account in
> the 'postmaster' NT service, but no luck.
>
>     I then checked /var/log/postmaster.log, which contained
>     ____________________________________________________________
>     FATAL:  invalid value for option 'LC_MESSAGES': 'en_US'
>     ____________________________________________________________
>
> More research led me to the file
>     /usr/share/postgresql/data/postgresql.conf
>
> at the end of which is just such a setting for LC_MESSAGES.  But that's
> as far as I get.
>
>     I'm still scratching my head as to why one box works just fine and
> the other does not, and why this particular message.  Thoughts?  Ideas?
>
> P.S.    Though once again, it should not play a part, I thought I better
>         mention that this new PC is running 2 CPUs, whereas my test box
>         only had 1.  Could this be an issue?  Is PostgreSQL sensitive
>     to dual CPU boxes?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>