Re: [HACKERS] Getting server crash on Windows when using ICU collation - Mailing list pgsql-hackers

From Ashutosh Sharma
Subject Re: [HACKERS] Getting server crash on Windows when using ICU collation
Date
Msg-id CAE9k0P=r1TGkXeJYUN9VBYnDufsXNT-XX1n1WXeqZDg+tqN7pQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Getting server crash on Windows when using ICU collation  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
Hi,

Attached is the patch that detects the ICU version on Windows and
based on that it decides whether 'HAVE_UCOL_STRCOLLUTF8' flag needs to
be set or not.  If this patch gets consisdered then, we may have to
revert the changes following git commit. Thanks.

commit e42645ad92687a2250ad17e1a045da73e54a5064
Author: Peter Eisentraut <peter_e@gmx.net>
Date:   Fri Jun 16 21:23:22 2017 -0400

    Define HAVE_UCOL_STRCOLLUTF8 on Windows

    This should normally be determined by a configure check, but until
    someone figures out how to do that on Windows, it's better that the code
    uses the new function by default.

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

On Sat, Jun 17, 2017 at 9:16 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Sat, Jun 17, 2017 at 6:57 AM, Peter Eisentraut
> <peter.eisentraut@2ndquadrant.com> wrote:
>> On 6/16/17 10:12, Peter Eisentraut wrote:
>>> On 6/16/17 06:30, Amit Kapila wrote:
>>>> How will this compare UTF-8 strings in UTF-8 encoding?  It seems to me
>>>> that ideally, it should use ucol_strcollUTF8 to compare the same,
>>>> however, with patch, it will always ucol_strcoll as we never define
>>>> HAVE_UCOL_STRCOLLUTF8 flag on Windows.
>>>
>>> We have a configure check for that, but I don't know how to replicate
>>> that on Windows.
>>>
>>> If ucol_strcollUTF8 is not available, we have code to convert to UTF-16.
>>>  This is the same code that is used for non-Windows.
>>
>> After thinking about this some more, I have committed a change to define
>> HAVE_UCOL_STRCOLLUTF8 on Windows unconditionally.  Until someone figures
>> out a different way, I think it's better that users of newish versions
>> of ICU get the newer/better behavior, and users of older versions can
>> file a bug.
>>
>
> Yeah, we can take that stand or maybe document that as well but not
> sure that is the best way to deal with it.  I have just posted one way
> to determine if icu library has support for ucol_strcollUTF8, see if
> that sounds like a way forward to you.
>
> --
> With Regards,
> Amit Kapila.
> EnterpriseDB: http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Euler Taveira
Date:
Subject: Re: [HACKERS] [BUGS] BUG #14699: Statement trigger and logical replication
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Getting server crash on Windows when using ICUcollation