Re: Repeatedly breaking indexes - SOLVED - Mailing list pgsql-bugs

From Martin Edlman
Subject Re: Repeatedly breaking indexes - SOLVED
Date
Msg-id Pine.LNX.4.44.0312020758300.7095-100000@worm.fortech.cz
Whole thread Raw
In response to Re: Repeatedly breaking indexes - SOLVED  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
> "ps" is not a reliable guide to the locale settings being used by
> Postgres.

Maybe it's RedHat related, I don't know.
When I had en_US in /etc/sysconfig/i18n and cs_CZ in
~postgres/.bash_profile and when I did (as root) `su - postgres -s /bin/sh
-c "echo $LANG"' I saw LANG=en_US (!!!), when I did `su - postgres' and
then `echo $LANG' (as postgres) I saw LANG=cs_CZ.
So I believe that ps gives correct info and I believe that postmaster was
running with en_US locales. It seems that the problem is with `su' which
may not run user's .bash* scripts when executing command with -c.

> The postmaster will adopt LC_COLLATE and LC_CTYPE from the settings
> recorded in pg_control (by initdb) regardless of its environment.

That's what I was hoping for, but unfortunately I didn't work this way.

I isolated the problem when trying Pg on different HW. I installed RH from
install CD and fortunatelly installed it with cs_CZ as default. Then
evertyhing worked - the same Pg, the same database. After that I looked at
`ps axe' and saw the difference in LANG.

> So I'm not convinced that you've correctly identified the problem.
> However, it seems possible that part of the issue is misbehavior if
> the various LC_xxx settings aren't all alike --- could you dig further
> and try to isolate it?

I set ALL LC_xxx variables to cs_CZ in postgres.conf but it didn't help.
Only setting LANG to cs_CZ in systemwide settings.

Regards, Martin

--

Martin Edlman
Fortech s.r.o, Litomysl
Public PGP key: http://edas.visaci.cz/#keys

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PATCH: Uninitialized variable usage in contrib/pg_autovacuum
Next
From: "cnliou"
Date:
Subject: Setting time zone commands