Yes, it really depends on Locale. If I created a
database with Locale = C, the problem won't happen (at
least so far). BTW, I forgot to mention I tested with
some Chinese and Japanese characters.
However, it raises another issue why a wrong Locale
would damage index? It shall only affect records with
wrong conversion, not something like '1000'.
The real environment in my program is J2EE+JDBC. I
simply used pgAdmin to demonstrate the problem (not
caused by JDBC or so).
Though Locale C solved the problem, LIKE 'prefix%'
still uses Seq Scan. It is a job to change hundreds
(if not thousands SQL) to use BETWEEN/AND instead. Any
suggestion?
-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: Tuesday, February 22, 2005 12:19 AM
To: Richard Huxton
Cc: Tom Yeh; pgsql-bugs@postgresql.org
Subject: RE: [BUGS] BUG #1487: Index problem
> -----Original Message-----
> From: Richard Huxton [mailto:dev@archonet.com]
> Sent: 21 February 2005 16:13
> To: Dave Page
> Cc: Tom Yeh; pgsql-bugs@postgresql.org
> Subject: Re: [BUGS] BUG #1487: Index problem
>
> > pgAdmin uses libpq, just as psql does, so I cannot
imagine why this
> > would be the case. pgAdmin also does not do
anything to try
> to affect
> > query plans in any way.
>
> Could it set the encoding/locale differently to psql
(on the
> same machine)?
Good point, yes - it will try to set the encoding to
unicode if it can.
/D
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com