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

From: Roman Kononov <kononov(at)ftml(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5257: wrong results of SUBSTRING with SQL regular expressions
Date: 2010-01-02 22:25:27
Message-ID: 4B3FC7D7.9060605@ftml.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2010-01-02 22:59:07 Re: Failed to run initdb - not resolved bug 5130
Previous Message Tomas Studva 2010-01-02 21:53:38 Failed to run initdb - not resolved bug 5130