Re: select fails on indexed varchars.

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Krohn <alex@gossamer-threads.com>
Cc: pgsql-bugs@postgresql.org
Date: 2001-01-27T01:12:01Z
Lists: pgsql-bugs
Alex Krohn <alex@gossamer-threads.com> 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) );            
>         CREATE
>         links=# create index foodx on foo (a);                            
>         CREATE
>         links=# insert into foo values ('Test/Test');                     
>         INSERT 29689 1
>         links=# select * from foo;
>                      a             
>         ---------------------------
>          Test/Test                
>         (1 row)

>         links=# select * from foo where a like 'Test/%';
>          a 
>         ---
>         (0 rows)

How odd.  I get 'Test/Test' from the last select, under both 7.0.2
and current sources, when using C locale.  The query certainly looks
like the kind that would suffer from the LIKE-optimization problem in
non-C locales ... but we seem to have established that you've gotten
the postmaster switched into C locale.

What does EXPLAIN VERBOSE select * from foo where a like 'Test/%';
show?

			regards, tom lane