Re: [BUGS] select fails on indexed varchars.

2001-02-05 Thread Alex Krohn
Hi Tom, > >> What does EXPLAIN VERBOSE select * from foo where a like 'Test/%'; > >> show? > > Well, the indexqual is just what it should be for C locale: > > :indxqual (( > { EXPR :typeOid 16 :opType op :oper > { OPER :opno 1061 :opid 1052 :opresulttype 16 } :args ( > { VAR :varno 1 :varattn

Re: [BUGS] select fails on indexed varchars.

2001-01-29 Thread Tom Lane
> links=# select * from foo where a < 'Test0'::bpchar; > a > --- > (0 rows) > links=# > Are you saying the second test should have returned true under C locale? Yes. You are not really in C locale, or at least your postmaster isn't. This looks like ISO sorting rules to me --- perhaps

Re: [BUGS] select fails on indexed varchars.

2001-01-27 Thread Alex Krohn
Hi Tom, > Alex Krohn <[EMAIL PROTECTED]> writes: > >> On my machine, these produce 't' in C locale, but 'f' in en_US locale. > > > Seem to be in C locale: > > So it does. Okay, what was the complete test case again? > I'm afraid I didn't save your original message because I wrote it off > as a

Re: [BUGS] select fails on indexed varchars.

2001-01-27 Thread Alex Krohn
Hi Tom, > >> So it does. Okay, what was the complete test case again? > >> I'm afraid I didn't save your original message because I wrote it off > >> as a known problem ... > > > Here it is: > > > links=# create table foo ( a char(25) ); > > CREATE > > links

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: >> What does EXPLAIN VERBOSE select * from foo where a like 'Test/%'; >> show? Well, the indexqual is just what it should be for C locale: :indxqual (( { EXPR :typeOid 16 :opType op :oper { OPER :opno 1061 :opid 1052 :opresulttype 16 } :args ( { VAR :varn

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: >>> Seem to be in C locale: >> >> So it does. Okay, what was the complete test case again? >> I'm afraid I didn't save your original message because I wrote it off >> as a known problem ... > Here it is: > links=# create table foo ( a char(25) );

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: >> On my machine, these produce 't' in C locale, but 'f' in en_US locale. > Seem to be in C locale: So it does. Okay, what was the complete test case again? I'm afraid I didn't save your original message because I wrote it off as a known problem ...

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Alex Krohn
Hi Tom, > > [postgres@penguin pgsql]$ locale > > LANG=en_US > > LC_CTYPE="en_US" > > LC_NUMERIC="en_US" > > LC_TIME="en_US" > > LC_COLLATE="en_US" > > LC_MONETARY="en_US" > > LC_MESSAGES="en_US" > > LC_ALL=en_US > > [postgres@penguin pgsql]$ > > > Postmaster is running as user pgsql. Any ideas o

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Alex Krohn
Hi Tom, > > I added to the startup file: > > LANG=C > > LC_CTYPE=C > > LC_NUMERIC=C > > LC_TIME=C > > LC_COLLATE=C > > LC_MONETARY=C > > LC_MESSAGES=C > > LC_ALL=C > > Seems reasonable. It's possible you needed "export" commands in there > too, but I wouldn't have thought so (anything coming in

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Alex Krohn
Hi Tom, > Alex Krohn <[EMAIL PROTECTED]> writes: > > links=# select * from foo where a like 'Test/%' > > links-# ; > > a > > --- > > (0 rows) > > This looks like an artifact of the known problems with LIKE index > optimization in non-ASCII locales. What

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Alex Krohn
Hi, > Alex Krohn <[EMAIL PROTECTED]> writes: > >> Beware of changing the postmaster's locale on the fly, however, > >> since that will leave you with corrupted (out-of-order) indexes. > >> Safest to dump/initdb in new locale/reload. > > > How would I go about changing that? Setting LANG and LC_A

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Alex Krohn
Hi, > > So I added: > > LANG=C > > LC_ALL=C > > to the /etc/rc.d/init.d/postgres file and stop, restarted the server. I > > then dropped and recreated the database. However still same results. > > LC_COLLATE overrides LC_ALL, I think --- didn't you previously show us > that all the LC_xxx famil

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: > I added to the startup file: > LANG=C > LC_CTYPE=C > LC_NUMERIC=C > LC_TIME=C > LC_COLLATE=C > LC_MONETARY=C > LC_MESSAGES=C > LC_ALL=C Seems reasonable. It's possible you needed "export" commands in there too, but I wouldn't have thought so (anything com

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: > So I added: > LANG=C > LC_ALL=C > to the /etc/rc.d/init.d/postgres file and stop, restarted the server. I > then dropped and recreated the database. However still same results. LC_COLLATE overrides LC_ALL, I think --- didn't you previously show us that al

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: >> Beware of changing the postmaster's locale on the fly, however, >> since that will leave you with corrupted (out-of-order) indexes. >> Safest to dump/initdb in new locale/reload. > How would I go about changing that? Setting LANG and LC_ALL in the pgsql >

Re: [BUGS] select fails on indexed varchars.

2001-01-26 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: > [postgres@penguin pgsql]$ locale > LANG=en_US > LC_CTYPE="en_US" > LC_NUMERIC="en_US" > LC_TIME="en_US" > LC_COLLATE="en_US" > LC_MONETARY="en_US" > LC_MESSAGES="en_US" > LC_ALL=en_US > [postgres@penguin pgsql]$ > Postmaster is running as user pgsql. Any i

Re: [BUGS] select fails on indexed varchars.

2001-01-25 Thread Tom Lane
Alex Krohn <[EMAIL PROTECTED]> writes: > links=# select * from foo where a like 'Test/%' > links-# ; > a > --- > (0 rows) This looks like an artifact of the known problems with LIKE index optimization in non-ASCII locales. What locale are you running the