diff options
Diffstat (limited to 'src/test/regress/sql/copy2.sql')
-rw-r--r-- | src/test/regress/sql/copy2.sql | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/regress/sql/copy2.sql b/src/test/regress/sql/copy2.sql index c46128b38a1..bd27a25c026 100644 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -270,6 +270,25 @@ e SELECT * FROM vistest; COMMIT; SELECT * FROM vistest; + +-- test case with whole-row Var in a check constraint +create table check_con_tbl (f1 int); +create function check_con_function(check_con_tbl) returns bool as $$ +begin + raise notice 'input = %', row_to_json($1); + return $1.f1 > 0; +end $$ language plpgsql immutable; +alter table check_con_tbl add check (check_con_function(check_con_tbl.*)); +\d+ check_con_tbl +copy check_con_tbl from stdin; +1 +\N +\. +copy check_con_tbl from stdin; +0 +\. +select * from check_con_tbl; + DROP TABLE vistest; DROP FUNCTION truncate_in_subxact(); DROP TABLE x, y; |