Re: BUG #5257: wrong results of SUBSTRING with SQL regular expressions - Mailing list pgsql-bugs

From Roman Kononov
Subject Re: BUG #5257: wrong results of SUBSTRING with SQL regular expressions
Date
Msg-id 4B3FC7D7.9060605@ftml.net
Whole thread Raw
In response to BUG #5257: wrong results of SUBSTRING with SQL regular expressions  ("Roman Kononov" <kononov@ftml.net>)
List pgsql-bugs
I don't know what SQL2008 says about SUBSTRING, but SQL2003 says in
ISO/IEC 9075-2:2003 (E), 6.29 <string value function>, 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 followed by <double quote>, then an
exception condition is raised: data exception - invalid use of escape
character.

This means that the following is wrong:

test-std=# select substring('a' from 'a' for '#');
  substring
-----------
  a
(1 row)

pgsql-bugs by date:

Previous
From: Tomas Studva
Date:
Subject: Failed to run initdb - not resolved bug 5130
Next
From: John R Pierce
Date:
Subject: Re: Failed to run initdb - not resolved bug 5130