Обсуждение: lc_ctype does not work on windows ?

Поиск
Список
Период
Сортировка

lc_ctype does not work on windows ?

От
Filip Rembiałkowski
Дата:
Hi

I have a problem with locale on windows.
postgresql 8.4.

this does not work as expected:

filip=# select 'A' ~ '\w', 'Ą' ~ '\w';
 ?column? | ?column?
----------+----------
 t        | f
(1 row)

-- investigating postgres settings:
filip=# select name, setting, context, source, boot_val, reset_val
from pg_settings where name ~*
'(lc|encoding|locale|char|text|version)';
            name            |      setting      |  context  |
source       |     boot_val      |     reset_val

----------------------------+-------------------+-----------+--------------------+-------------------+-------------------
 client_encoding            | win1250           | user      | session
          | SQL_ASCII         | UTF8
 default_text_search_config | pg_catalog.simple | user      |
configuration file | pg_catalog.simple | pg_catalog.simple
 lc_collate                 | Polish, Poland    | internal  | override
          | C                 | Polish, Poland
 lc_ctype                   | Polish, Poland    | internal  | override
          | C                 | Polish, Poland
 lc_messages                | Polish, Poland    | superuser |
configuration file |                   | Polish, Poland
 lc_monetary                | Polish, Poland    | user      |
configuration file | C                 | Polish, Poland
 lc_numeric                 | Polish, Poland    | user      |
configuration file | C                 | Polish, Poland
 lc_time                    | Polish, Poland    | user      |
configuration file | C                 | Polish, Poland
 server_encoding            | UTF8              | internal  | override
          | SQL_ASCII         | UTF8
 server_version             | 8.4.2             | internal  | default
          | 8.4.2             | 8.4.2
 server_version_num         | 80402             | internal  | default
          | 80402             | 80402
(11 rows)

-- and database settings:
filip=# select * from pg_database where datname='filip';
-[ RECORD 1 ]-+---------------
datname       | filip
datdba        | 2650623
encoding      | 6
datcollate    | Polish, Poland
datctype      | Polish, Poland
datistemplate | f
datallowconn  | t
datconnlimit  | -1
datlastsysoid | 11563
datfrozenxid  | 649
dattablespace | 1663
datconfig     |
datacl        |





--
Filip Rembiałkowski
JID,mailto:filip.rembialkowski@gmail.com
http://filip.rembialkowski.net/

Re: lc_ctype does not work on windows ?

От
Tom Lane
Дата:
=?UTF-8?Q?Filip_Rembia=C5=82kowski?= <plk.zuber@gmail.com> writes:
> I have a problem with locale on windows.
> postgresql 8.4.

> this does not work as expected:

> filip=# select 'A' ~ '\w', 'Ą' ~ '\w';

The locale-aware regex operators don't really work in multibyte
encodings.  There's a (partial) fix for this in 9.0, but we don't
trust it yet so it's not been back-patched.

            regards, tom lane