Re: [HACKERS] regular expressions stranges

2007-01-23 Thread Tom Lane
Teodor Sigaev <[EMAIL PROTECTED]> writes: >> The regex code is working with pg_wchar strings, which aren't >> necessarily the same representation that the OS' wide-char functions >> expect. If we could guarantee compatibility then the above plan >> would make sense ... > it seems to me, that is p

Re: [HACKERS] regular expressions stranges

2007-01-23 Thread Teodor Sigaev
The regex code is working with pg_wchar strings, which aren't necessarily the same representation that the OS' wide-char functions expect. If we could guarantee compatibility then the above plan would make sense ... it seems to me, that is possible for UTF8 encoding. So isalpha() function may b

Re: [HACKERS] regular expressions stranges

2007-01-23 Thread Tom Lane
Teodor Sigaev <[EMAIL PROTECTED]> writes: > As I can see, that is because of using isalpha (and other is*), tolower & > toupper instead of isw* and tow* functions. Is any reason to use them? If > not, I > can modify regc_locale.c similarly to tsearch2 locale part. The regex code is working with

[HACKERS] regular expressions stranges

2007-01-23 Thread Teodor Sigaev
Regexp works differently with no-ascii characters depending on server encoding (bug.sql contains non-ascii char): % initdb -E KOI8-R --locale ru_RU.KOI8-R % psql postgres < bug.sql true -- t (1 row) true | true --+-- t| t (1 row) % initdb -E UTF8 --locale ru_RU.UTF-8 % psql