summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/strings.out
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-09-22 17:27:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-09-22 17:27:25 +0000
commit9946b83dedb629b9eff1c063b9fbcaab25c209df (patch)
treeb95a72601c503b1139154c1d95561c37b9dfabf8 /src/test/regress/expected/strings.out
parentac355d558e27dd6b11b1d202de887a6d62d22ac6 (diff)
downloadpostgresql-9946b83dedb629b9eff1c063b9fbcaab25c209df.tar.gz
Bring SIMILAR TO and SUBSTRING into some semblance of conformance with
the SQL99 standard. (I'm not sure that the character-class features are quite right, but that can be fixed later.) Document SQL99 and POSIX regexps as being different features; provide variants of SUBSTRING for each.
Diffstat (limited to 'src/test/regress/expected/strings.out')
-rw-r--r--src/test/regress/expected/strings.out18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/test/regress/expected/strings.out b/src/test/regress/expected/strings.out
index 576fafb772..a73ca1aa84 100644
--- a/src/test/regress/expected/strings.out
+++ b/src/test/regress/expected/strings.out
@@ -142,15 +142,15 @@ SELECT SUBSTRING('1234567890' FROM 4 FOR 3) = '456' AS "456";
t
(1 row)
--- T581 regular expression substring
-SELECT SUBSTRING('abcdefg' FROM '(b|f).*(d)' FOR '#') AS "bcd";
+-- T581 regular expression substring (with SQL99's bizarre regexp syntax)
+SELECT SUBSTRING('abcdefg' FROM 'a#"(b_d)#"%' FOR '#') AS "bcd";
bcd
-----
bcd
(1 row)
-- No match should return NULL
-SELECT SUBSTRING('abcdefg' FROM '(1|2|3)' FOR '#') IS NULL AS "True";
+SELECT SUBSTRING('abcdefg' FROM '#"(b_d)#"%' FOR '#') IS NULL AS "True";
True
------
t
@@ -175,8 +175,16 @@ SELECT SUBSTRING('abcdefg' FROM NULL FOR '#') IS NULL AS "True";
t
(1 row)
--- PostgreSQL extention to allow omitting the escape character
-SELECT SUBSTRING('abcdefg' FROM '(c|d).e') AS "cde";
+-- PostgreSQL extension to allow omitting the escape character;
+-- here the regexp is taken as Posix syntax
+SELECT SUBSTRING('abcdefg' FROM 'c.e') AS "cde";
+ cde
+-----
+ cde
+(1 row)
+
+-- With a parenthesized subexpression, return only what matches the subexpr
+SELECT SUBSTRING('abcdefg' FROM 'b(.*)f') AS "cde";
cde
-----
cde