| From: | Per Nyfelt <per(dot)nyfelt(at)resourcing(dot)se> |
|---|---|
| To: | pgsql-cygwin(at)postgresql(dot)org |
| Subject: | ilike locale problems on cygwin |
| Date: | 2003-01-20 11:04:26 |
| Message-ID: | 200301201204.26302.per.nyfelt@resourcing.se |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-cygwin |
I'm running Postgres 7.3.1 configured with --with-mb=UNICODE --with-locale on
both Linux (Slackware 8.1) and Windows 2000 (cygwin 1.3.18 (0.69/3/2))
The data stored will be english, swedish, danish, norwegian, chinese and
german so I want to use UNICODE encoding to be able to support that. I also
need to be able to ignore cases (when the characters stored have such a thing
as cases) so this is why i need locale support so that I can set one database
that has swedish data to sv_SE, zh_CN for the one with chinese data etc.
On Linux everything works fine, I am able to insert and retrieve data without
problems. On Cygwin, however, when I'm using ilike(), lower() and upper() I
don't get characters other than A-Z converted.
databases are initialized as follows:
initdb -E UNICODE --lc-ctype=sv_SE -D /usr/local/pgsql/data
and created as follows:
> psql -l
List of databases
Name | Owner | Encoding
-----------+----------+----------
rpn | postgres | UNICODE
template0 | postgres | UNICODE
template1 | postgres | UNICODE
Using a Java swing client (dbVisualizer) and the JDBC driver (pg73jdbc3.jar)
to connect to the database:
SHOW CLIENT_ENCODING
returns the value "UNICODE" (my quotes)
create table test(
name varchar(30)
);
insert into test values ('Övik');
select * from test where name ilike '%öv%';
gives me the expected result "Övik" (my quotes)
So on Linux everything works fine: all conversions works as expected, but on
Cygwin
select * from test where name ilike '%öv%';
gives me no matches but
select * from test where name ilike '%Öv%';
gives me the expected result "Övik" (my quotes)
I've tried to initialize the db using both --lc-ctype=sv_SE and --lc-ctype=sv
but neither of them gives me the correct result it still seems to be using
standard C locale (my guess) for character conversion.
The Cygwin environment is installed without any modifications. I just followed
the instructions for setting up Postgres.
/usr/share/locale has a subdir for sv and /usr/share/locale/locale.alias has
the following value for swedish: sv_SE.ISO-8859-1
Any suggestions for how to make Postgres on Cygwin behave the same way as on
linux with regards to locale settings and ilike would be most welcome.
Best regards,
Per
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jason Tishler | 2003-01-20 15:00:32 | Re: ilike locale problems on cygwin |
| Previous Message | Oliver Vecernik | 2003-01-20 07:32:42 | Re: Upgrading to 7.3.1 problem |