diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/input/misc.source | 11 | ||||
| -rw-r--r-- | src/test/regress/output/constraints.source | 4 | ||||
| -rw-r--r-- | src/test/regress/output/misc.source | 39 |
3 files changed, 52 insertions, 2 deletions
diff --git a/src/test/regress/input/misc.source b/src/test/regress/input/misc.source index ebf13626c7f..cfaaea95131 100644 --- a/src/test/regress/input/misc.source +++ b/src/test/regress/input/misc.source @@ -219,6 +219,17 @@ SELECT hobbies_by_name('basketball'); SELECT name, overpaid(emp.*) FROM emp; -- +-- Try a few cases with SQL-spec row constructor expressions +-- +SELECT * FROM equipment(ROW('skywalking', 'mer')); + +SELECT name(equipment(ROW('skywalking', 'mer'))); + +SELECT *, name(equipment(h.*)) FROM hobbies_r h; + +SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h; + +-- -- check that old-style C functions work properly with TOASTed values -- create table oldstyle_test(i int4, t text); diff --git a/src/test/regress/output/constraints.source b/src/test/regress/output/constraints.source index 52ecabbd908..2237e0c5966 100644 --- a/src/test/regress/output/constraints.source +++ b/src/test/regress/output/constraints.source @@ -45,9 +45,9 @@ SELECT '' AS four, * FROM DEFAULTEXPR_TBL; -- syntax errors -- test for extraneous comma CREATE TABLE error_tbl (i int DEFAULT (100, )); -ERROR: syntax error at or near "," at character 43 +ERROR: syntax error at or near ")" at character 45 LINE 1: CREATE TABLE error_tbl (i int DEFAULT (100, )); - ^ + ^ -- this will fail because gram.y uses b_expr not a_expr for defaults, -- to avoid a shift/reduce conflict that arises from NOT NULL being -- part of the column definition syntax: diff --git a/src/test/regress/output/misc.source b/src/test/regress/output/misc.source index 3173f718c6c..0c1ed5deaf4 100644 --- a/src/test/regress/output/misc.source +++ b/src/test/regress/output/misc.source @@ -687,6 +687,45 @@ SELECT name, overpaid(emp.*) FROM emp; (6 rows) -- +-- Try a few cases with SQL-spec row constructor expressions +-- +SELECT * FROM equipment(ROW('skywalking', 'mer')); + name | hobby +------+------------ + guts | skywalking +(1 row) + +SELECT name(equipment(ROW('skywalking', 'mer'))); + name +------ + guts +(1 row) + +SELECT *, name(equipment(h.*)) FROM hobbies_r h; + name | person | name +-------------+--------+--------------- + posthacking | mike | advil + posthacking | mike | peet's coffee + posthacking | jeff | advil + posthacking | jeff | peet's coffee + basketball | joe | hightops + basketball | sally | hightops + skywalking | | guts +(7 rows) + +SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h; + name | person | name +-------------+--------+--------------- + posthacking | mike | advil + posthacking | mike | peet's coffee + posthacking | jeff | advil + posthacking | jeff | peet's coffee + basketball | joe | hightops + basketball | sally | hightops + skywalking | | guts +(7 rows) + +-- -- check that old-style C functions work properly with TOASTed values -- create table oldstyle_test(i int4, t text); |
