Re: lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux - Mailing list pgsql-general

From Charles Clavadetscher
Subject Re: lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux
Date
Msg-id 018601d1f14e$afca2a20$0f5e7e60$@swisspug.org
Whole thread Raw
In response to Re: lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
Hello Alexander

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Alexander Farber
> Sent: Montag, 8. August 2016 10:21
> Cc: pgsql-general <pgsql-general@postgresql.org>
> Subject: Re: [GENERAL] lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux
>
> Hello Charles, unfortunately on Windows 7 this fails:
>
> psql (9.5.3)
> Type "help" for help.
>
> # select lower(('И'::text collate "en_US")) ;
> ERROR:  collation "en_US" for encoding "UTF8" does not exist LINE 1: select lower(('?'::text collate "en_US")) ;

I assume that you did not create the collation yet as I mentioned in a previous mail.

kofadmin@test.localhost=> CREATE COLLATION "en_US" (LOCALE = 'English_United States.1252');
CREATE COLLATION

Which locale can be created depends on those available on your OS.

Bye
Charles

> By the way I the following code works well for me on all 3 platforms:
>
> CREATE TABLE words_verbs (
>         word varchar(255) PRIMARY KEY CHECK (
>                 word ~ '^[А-Я]{2,}$' AND
>                 word !~ '[ЖШ]Ы' AND
>                 word !~ '[ЧЩ]Я' AND
>                 word !~ 'Ц[ЮЯ]' AND
>                 (word ~ '[ТЧ]ЬСЯ$' OR
>                  word ~ '[ТЧ]Ь$' OR
>                  word ~ 'ТИ$')),
>         hashed varchar(32) NOT NULL
> );
>
>
> but I understand that it is probably different methods on the lower layer (pcre instead of some collating
> functions?)....
>
>
> Regards
>
> Alex




pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux
Next
From: Pekka Rinne
Date:
Subject: Re: upgrade to repmgr3