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

2010-01-02 Thread Roman Kononov
I don't know what SQL2008 says about SUBSTRING, but SQL2003 says in ISO/IEC 9075-2:2003 (E), 6.29 , General Rules, 5), page 261: d) If R [the regular expression] does not contain exactly two occurrences of the two-character sequence consisting of E [the escape character], each immediately fol

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

2010-01-02 Thread Tom Lane
"Roman Kononov" 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=#

[BUGS] BUG #5257: wrong results of SUBSTRING with SQL regular expressions

2010-01-02 Thread Roman Kononov
The following bug has been logged online: Bug reference: 5257 Logged by: Roman Kononov Email address: kono...@ftml.net PostgreSQL version: 8.4.2 Operating system: GNU/Linux x86_64 Description:wrong results of SUBSTRING with SQL regular expressions Details: test=# se