Re: regex match and special characters

2018-08-18 Thread Adrian Klaver
On 08/18/2018 08:12 AM, Oleksii Kliukin wrote: Hi Adrian, On 16. Aug 2018, at 18:13, Adrian Klaver > wrote: test=# select 'abcd'||chr(8198) ~ 'abcd\s'; ?column? -- t (1 row) Wonder if the OP has standard_conforming_strings='off' and escape_string_war

Re: regex match and special characters

2018-08-18 Thread Oleksii Kliukin
Hi Adrian, > On 16. Aug 2018, at 18:13, Adrian Klaver wrote: > > test=# select 'abcd'||chr(8198) ~ 'abcd\s'; > ?column? > -- > t > (1 row) > > > Wonder if the OP has standard_conforming_strings='off' and > escape_string_warning='off'? > Both are set to ‘on’ for me for all versions (I

Re: regex match and special characters

2018-08-18 Thread Oleksii Kliukin
> On 16. Aug 2018, at 16:57, Tom Lane wrote: > > Alex Kliukin writes: >> Here is a simple SQL statement that gives different results on PostgreSQL >> 9.6 and PostgreSQL 10+. The space character at the end of the string is >> actually U+2006 SIX-PER-EM SPACE >> (http://www.fileformat.info/inf

Re: Sv: Re: Sv: Re: regex match and special characters

2018-08-16 Thread Adrian Klaver
On 08/16/2018 08:19 AM, Adrian Klaver wrote: On 08/16/2018 08:13 AM, Adrian Klaver wrote: Wonder if the OP has standard_conforming_strings='off' and escape_string_warning='off'? In the above referring to 9.6.9 instance. Well that theory is no good: test=# select version();

Re: Sv: Re: Sv: Re: regex match and special characters

2018-08-16 Thread Adrian Klaver
On 08/16/2018 08:13 AM, Adrian Klaver wrote: Wonder if the OP has standard_conforming_strings='off' and escape_string_warning='off'? In the above referring to 9.6.9 instance. -- *Andreas Joseph Krogh* CTO / Partner - Visena AS Mobile: +47 909 56 963 andr...@visena.com

Re: Sv: Re: Sv: Re: regex match and special characters

2018-08-16 Thread Tom Lane
Andreas Joseph Krogh writes: > When using E-syntax you need to double the backslash for escaping: > andreak@[local]:5433 10.4 andreak=# select 'abcd'||chr(8198) ~ E'abcd\\s'; Another thing to keep in mind is that this is all locale-dependent (specifically, LC_CTYPE, I believe). In plain old C l

Re: Sv: Re: Sv: Re: regex match and special characters

2018-08-16 Thread Adrian Klaver
On 08/16/2018 07:47 AM, Andreas Joseph Krogh wrote: På torsdag 16. august 2018 kl. 16:32:40, skrev Adrian Klaver mailto:adrian.kla...@aklaver.com>>: On 08/16/2018 07:04 AM, Andreas Joseph Krogh wrote: > char(2006) produces the wrong character as 2006 is the hex-value. You > have

Sv: Re: Sv: Re: regex match and special characters

2018-08-16 Thread Andreas Joseph Krogh
På torsdag 16. august 2018 kl. 16:32:40, skrev Adrian Klaver < adrian.kla...@aklaver.com >: On 08/16/2018 07:04 AM, Andreas Joseph Krogh wrote: > char(2006) produces the wrong character as 2006 is the hex-value. You > have to use 8198: > andreak@[local]:543310.

Re: Sv: Re: regex match and special characters

2018-08-16 Thread Adrian Klaver
On 08/16/2018 07:04 AM, Andreas Joseph Krogh wrote: char(2006) produces the wrong character as 2006 is the hex-value. You have to use 8198: andreak@[local]:543310.4 andreak=# select version(); ┌┐ │  

Sv: Re: regex match and special characters

2018-08-16 Thread Andreas Joseph Krogh
På torsdag 16. august 2018 kl. 15:16:52, skrev Adrian Klaver < adrian.kla...@aklaver.com >: On 08/16/2018 03:59 AM, Alex Kliukin wrote: > Hi, > > Here is a simple SQL statement that gives different results on PostgreSQL 9.6 and PostgreSQL 10+. The space charact

Re: regex match and special characters

2018-08-16 Thread Tom Lane
Alex Kliukin writes: > Here is a simple SQL statement that gives different results on PostgreSQL 9.6 > and PostgreSQL 10+. The space character at the end of the string is actually > U+2006 SIX-PER-EM SPACE > (http://www.fileformat.info/info/unicode/char/2006/index.htm) I think the reason for t

Re: regex match and special characters

2018-08-16 Thread Adrian Klaver
On 08/16/2018 03:59 AM, Alex Kliukin wrote: Hi, Here is a simple SQL statement that gives different results on PostgreSQL 9.6 and PostgreSQL 10+. The space character at the end of the string is actually U+2006 SIX-PER-EM SPACE (http://www.fileformat.info/info/unicode/char/2006/index.htm) tes

regex match and special characters

2018-08-16 Thread Alex Kliukin
Hi, Here is a simple SQL statement that gives different results on PostgreSQL 9.6 and PostgreSQL 10+. The space character at the end of the string is actually U+2006 SIX-PER-EM SPACE (http://www.fileformat.info/info/unicode/char/2006/index.htm) test=# select 'abcd ' ~ 'abcd\s'; ?column? -