dbTalk Databases Forums  

Re: [BUGS] Repeatedly breaking indexes - SOLVED

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] Repeatedly breaking indexes - SOLVED in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Edlman
 
Posts: n/a

Default Re: [BUGS] Repeatedly breaking indexes - SOLVED - 12-01-2003 , 12:41 AM






Hello,

finally the problem is solved. The problem was with locales.

I installed and initialised the database under cs_CZ, so Pg
recorded cs_CZ in all its configurations and startup scripts.
After that I changed /etc/sysconfig/i18n to use en_US locale as
system default.
And that was the problem. According to "ps axe" the postmaster was
running under en_US locales instead of cs_CZ as I expected.
So I changed /etc/sysconfig/i18n to use cs_CZ and everything is ok
from then. All indexes seem to be working fine and there are no problems.

But I would like to know why it was not started under cs_CZ when
all Pg config files specify cs_CZ and ~postgres/.bash_profile contains
export LANG="cs_CZ" and postmaster is run from it's rc script as

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA ...."

So I expected that cs_CZ will be used in this case. :-( GRrrrrr.

Ok now it's working, thank you all who helped.

Martin

Quote:
Tomas Szepe <szepe (AT) pinerecords (DOT) com> writes:
Martin, you can probably rule out the cs_CZ (LATIN2) locale as the cause
of your problems -- I've been using that one for years on many production
postgres systems (often huge and constantly loaded) and have never observed
the problems you're describing.

Thanks for the info. But are you using cs_CZ.ISO8859-2 in particular on
Red Hat 8.0 in particular? If it is a locale-related issue, it might be
specific to that particular variant on that platform.

I have RH 8.0 here, and could easily run some tests, but I'm not sure
what to look for. A quick run of the regression tests didn't reveal
any issues, other than expectable differences from C locale in sort
ordering.

regards, tom lane

--

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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Repeatedly breaking indexes - SOLVED - 12-01-2003 , 09:33 AM






Martin Edlman <edlman (AT) fortech (DOT) cz> writes:
Quote:
finally the problem is solved. The problem was with locales.

I installed and initialised the database under cs_CZ, so Pg
recorded cs_CZ in all its configurations and startup scripts.
After that I changed /etc/sysconfig/i18n to use en_US locale as
system default.
And that was the problem. According to "ps axe" the postmaster was
running under en_US locales instead of cs_CZ as I expected.
"ps" is not a reliable guide to the locale settings being used by
Postgres.

The postmaster will adopt LC_COLLATE and LC_CTYPE from the settings
recorded in pg_control (by initdb) regardless of its environment.
Other, noncritical, settings such as LC_MESSAGES are taken from
postgresql.conf if specified there. The environment values reported by
"ps" would only be used for noncritical settings, and then only if
not overridden by postgresql.conf.

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?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #3  
Old   
Martin Edlman
 
Posts: n/a

Default Re: [BUGS] Repeatedly breaking indexes - SOLVED - 12-02-2003 , 01:15 AM



Quote:
"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.

Quote:
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.

Quote:
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


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.