Re: BUG #5257: wrong results of SUBSTRING with SQL regular expressions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Roman Kononov" <kononov(at)ftml(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5257: wrong results of SUBSTRING with SQL regular expressions
Date: 2010-01-02 20:01:04
Message-ID: 10279.1262462464@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Roman Kononov" <kononov(at)ftml(dot)net> writes:
> test=# select substring('34' from '(2|3)#"4#"' for '#');
> substring
> -----------
> 3
> (1 row)

Hmm. I guess we need to translate ( and ) to non-capturing parens.

> test=# select substring('^' from '#"^#"' for '#');
> substring
> -----------
>
> (1 row)

> test=# select substring('$' from '#"$#"' for '#');
> substring
> -----------
>
> (1 row)

These cases are already fixed in HEAD.
http://archives.postgresql.org/pgsql-committers/2009-10/msg00048.php

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Studva 2010-01-02 21:45:40 test message
Previous Message Roman Kononov 2010-01-02 19:30:45 BUG #5257: wrong results of SUBSTRING with SQL regular expressions