Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-08-10 Thread Peter Eisentraut
On 8/10/17 22:21, Peter Geoghegan wrote: > On Thu, Aug 10, 2017 at 3:57 PM, Peter Geoghegan wrote: >> On Thu, Aug 10, 2017 at 11:02 AM, Robert Haas wrote: >>> On Fri, Jun 23, 2017 at 1:14 AM, Ashutosh Sharma >>> wrote: Okay, attached is the patch which first detects the platform type and >

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-08-10 Thread Peter Geoghegan
On Thu, Aug 10, 2017 at 3:57 PM, Peter Geoghegan wrote: > On Thu, Aug 10, 2017 at 11:02 AM, Robert Haas wrote: >> On Fri, Jun 23, 2017 at 1:14 AM, Ashutosh Sharma >> wrote: >>> Okay, attached is the patch which first detects the platform type and >>> runs the uconv commands accordingly from th

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-08-10 Thread Peter Geoghegan
On Thu, Aug 10, 2017 at 11:02 AM, Robert Haas wrote: > On Fri, Jun 23, 2017 at 1:14 AM, Ashutosh Sharma > wrote: >> Okay, attached is the patch which first detects the platform type and >> runs the uconv commands accordingly from the corresponding icu bin >> path. Please have a look and let me

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-08-10 Thread Robert Haas
On Fri, Jun 23, 2017 at 1:14 AM, Ashutosh Sharma wrote: > Okay, attached is the patch which first detects the platform type and > runs the uconv commands accordingly from the corresponding icu bin > path. Please have a look and let me know for any issues. Thanks. Should this be on the open items

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-22 Thread Ashutosh Sharma
Hi, On Wed, Jun 21, 2017 at 9:50 AM, Amit Kapila wrote: > On Wed, Jun 21, 2017 at 12:15 AM, Peter Eisentraut > wrote: >> On 6/20/17 09:23, Amit Kapila wrote: >>> To avoid that why can't we use the same icu path for executing uconv >>> as we are using for linking? >> >> Yeah, you'd need to use pr

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-20 Thread Amit Kapila
On Wed, Jun 21, 2017 at 12:15 AM, Peter Eisentraut wrote: > On 6/20/17 09:23, Amit Kapila wrote: >> To avoid that why can't we use the same icu path for executing uconv >> as we are using for linking? > > Yeah, you'd need to use prefix $self->{options}->{icu} . '\bin\uconv' or > something like tha

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-20 Thread Peter Eisentraut
On 6/20/17 09:23, Amit Kapila wrote: > To avoid that why can't we use the same icu path for executing uconv > as we are using for linking? Yeah, you'd need to use prefix $self->{options}->{icu} . '\bin\uconv' or something like that. -- Peter Eisentraut http://www.2ndQuadrant.com/ Po

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-20 Thread Peter Eisentraut
On 6/19/17 23:36, Ashutosh Sharma wrote: > In this case, even if i am trying to use ICU 53 libraries but as > dll's i am using is from ICU 49 (as my system PATH is pointing to ICU > 49 bin path) the uconv -V output would be '49.1' instead of '53.1'. In > such case, the postgres installation would

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-20 Thread Amit Kapila
On Tue, Jun 20, 2017 at 9:06 AM, Ashutosh Sharma wrote: > Hi, > > On Tue, Jun 20, 2017 at 2:36 AM, Peter Eisentraut > wrote: >> On 6/19/17 00:42, Ashutosh Sharma wrote: If we don't find unconv, isn't it better to fall back to non-UTF8 version rather than saying command not found? >>> We

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-19 Thread Ashutosh Sharma
Hi, On Tue, Jun 20, 2017 at 2:36 AM, Peter Eisentraut wrote: > On 6/19/17 00:42, Ashutosh Sharma wrote: >>> If we don't find unconv, isn't it better to fall back to non-UTF8 >>> version rather than saying command not found? >> Well, if any of the ICU package is installed on our system then we >>

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-19 Thread Peter Eisentraut
On 6/19/17 00:42, Ashutosh Sharma wrote: >> If we don't find unconv, isn't it better to fall back to non-UTF8 >> version rather than saying command not found? > Well, if any of the ICU package is installed on our system then we > will certainly find uconv command. The only case where we can see suc

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-18 Thread Ashutosh Sharma
Hi, On Sun, Jun 18, 2017 at 6:39 PM, Amit Kapila wrote: > On Sat, Jun 17, 2017 at 8:27 PM, Ashutosh Sharma > wrote: >> Hi, >> >> On Sat, Jun 17, 2017 at 6:38 PM, Peter Eisentraut >> wrote: >>> On 6/16/17 23:46, Amit Kapila wrote: I have just posted one way to determine if icu library

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-18 Thread Amit Kapila
On Sat, Jun 17, 2017 at 8:27 PM, Ashutosh Sharma wrote: > Hi, > > On Sat, Jun 17, 2017 at 6:38 PM, Peter Eisentraut > wrote: >> On 6/16/17 23:46, Amit Kapila wrote: >>> I have just posted one way >>> to determine if icu library has support for ucol_strcollUTF8, see if >>> that sounds like a way f

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-17 Thread Ashutosh Sharma
Hi, On Sat, Jun 17, 2017 at 6:38 PM, Peter Eisentraut wrote: > On 6/16/17 23:46, Amit Kapila wrote: >> 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. > > I'm not in a position to test such patches, so so

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-17 Thread Peter Eisentraut
On 6/16/17 23:46, Amit Kapila wrote: > 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. I'm not in a position to test such patches, so someone else will have to take that on. It might not be worth bothering.

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-17 Thread Ashutosh Sharma
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 e42645ad92687a2250ad17e1a045da73

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-16 Thread Amit Kapila
On Sat, Jun 17, 2017 at 6:57 AM, Peter Eisentraut 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,

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-16 Thread Amit Kapila
On Fri, Jun 16, 2017 at 7:42 PM, 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 n

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-16 Thread Ashutosh Sharma
Hi, On Sat, Jun 17, 2017 at 6:57 AM, Peter Eisentraut 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, >>> how

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-16 Thread Peter Eisentraut
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 >> H

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-16 Thread Peter Eisentraut
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

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-16 Thread Peter Eisentraut
On 6/15/17 13:48, Ashutosh Sharma wrote: >> Maybe just >> >> diff --git a/src/backend/utils/adt/varlena.c >> b/src/backend/utils/adt/varlena.c >> index a0dd391f09..2506f4eeb8 100644 >> --- a/src/backend/utils/adt/varlena.c >> +++ b/src/backend/utils/adt/varlena.c >> @@ -1433,7 +1433,7 @@ varstr_cm

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-16 Thread Amit Kapila
On Thu, Jun 15, 2017 at 11:18 PM, Ashutosh Sharma wrote: > Hi, > > On Thu, Jun 15, 2017 at 8:36 PM, Peter Eisentraut > wrote: >> On 6/12/17 00:38, Ashutosh Sharma wrote: >>> PFA patch that fixes the issue described in above thread. As mentioned >>> in the above thread, the crash is basically happ

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Ashutosh Sharma
Hi, On Thu, Jun 15, 2017 at 8:36 PM, Peter Eisentraut wrote: > On 6/12/17 00:38, Ashutosh Sharma wrote: >> PFA patch that fixes the issue described in above thread. As mentioned >> in the above thread, the crash is basically happening in varstr_cmp() >> function and it's only happening on Windo

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Ashutosh Sharma
Hi, On Thu, Jun 15, 2017 at 7:43 PM, Amit Kapila wrote: > On Mon, Jun 12, 2017 at 10:08 AM, Ashutosh Sharma > wrote: >> PFA patch that fixes the issue described in above thread. As mentioned >> in the above thread, the crash is basically happening in varstr_cmp() >> function and it's only hap

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Peter Eisentraut
On 6/12/17 00:38, Ashutosh Sharma wrote: > PFA patch that fixes the issue described in above thread. As mentioned > in the above thread, the crash is basically happening in varstr_cmp() > function and it's only happening on Windows because in varstr_cmp(), > if the collation provider is ICU, we d

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Amit Kapila
On Mon, Jun 12, 2017 at 10:08 AM, Ashutosh Sharma wrote: > PFA patch that fixes the issue described in above thread. As mentioned > in the above thread, the crash is basically happening in varstr_cmp() > function and it's only happening on Windows because in varstr_cmp(), > if the collation prov

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-11 Thread Ashutosh Sharma
PFA patch that fixes the issue described in above thread. As mentioned in the above thread, the crash is basically happening in varstr_cmp() function and it's only happening on Windows because in varstr_cmp(), if the collation provider is ICU, we don't even think of calling ICU functions to compa

[HACKERS] Getting server crash on Windows when using ICU collation

2017-06-10 Thread Ashutosh Sharma
Hi All, I am seeing a server crash when running queries using ICU collations on Windows. Following are the steps to reproduce the crash with the help of patch to enable icu feature on Windows - [1], 1) psql -d postgres 2) CREATE DATABASE icu_win_test TEMPLATE template0 ENCODING 'UTF8'