diff options
| author | Tom Lane | 2018-02-14 03:15:08 +0000 |
|---|---|---|
| committer | Tom Lane | 2018-02-14 03:15:08 +0000 |
| commit | f9263006d871d127794a402a7bef713fdd882156 (patch) | |
| tree | 67a455d0e2a3f9dc61bd4c19088bdfb435a21328 /src/test | |
| parent | fd333bc763ea104f2a2c10c6b0061c996d4a2f5a (diff) | |
Support CONSTANT/NOT NULL/initial value for plpgsql composite variables.
These features were never implemented previously for composite or record
variables ... not that the documentation admitted it, so there's no doc
updates here.
This also fixes some issues concerning enforcing DOMAIN NOT NULL
constraints against plpgsql variables, although I'm not sure that
that topic is completely dealt with.
I created a new plpgsql test file for these features, and moved the
one relevant existing test case into that file.
Tom Lane, reviewed by Daniel Gustafsson
Discussion: https://postgr.es/m/18362.1514605650@sss.pgh.pa.us
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/plpgsql.out | 36 | ||||
| -rw-r--r-- | src/test/regress/sql/plpgsql.sql | 26 |
2 files changed, 0 insertions, 62 deletions
diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out index 0c1da088697..d294e536345 100644 --- a/src/test/regress/expected/plpgsql.out +++ b/src/test/regress/expected/plpgsql.out @@ -4586,42 +4586,6 @@ select scope_test(); (1 row) drop function scope_test(); --- Check that variables are reinitialized on block re-entry. -\set VERBOSITY terse \\ -- needed for output stability -do $$ -begin - for i in 1..3 loop - declare - x int; - y int := i; - r record; - c int8_tbl; - begin - if i = 1 then - x := 42; - r := row(i, i+1); - c := row(i, i+1); - end if; - raise notice 'x = %', x; - raise notice 'y = %', y; - raise notice 'r = %', r; - raise notice 'c = %', c; - end; - end loop; -end$$; -NOTICE: x = 42 -NOTICE: y = 1 -NOTICE: r = (1,2) -NOTICE: c = (1,2) -NOTICE: x = <NULL> -NOTICE: y = 2 -NOTICE: r = <NULL> -NOTICE: c = <NULL> -NOTICE: x = <NULL> -NOTICE: y = 3 -NOTICE: r = <NULL> -NOTICE: c = <NULL> -\set VERBOSITY default -- Check handling of conflicts between plpgsql vars and table columns. set plpgsql.variable_conflict = error; create function conflict_test() returns setof int8_tbl as $$ diff --git a/src/test/regress/sql/plpgsql.sql b/src/test/regress/sql/plpgsql.sql index 6bdcfe7cc58..f17cf0b49bf 100644 --- a/src/test/regress/sql/plpgsql.sql +++ b/src/test/regress/sql/plpgsql.sql @@ -3735,32 +3735,6 @@ select scope_test(); drop function scope_test(); --- Check that variables are reinitialized on block re-entry. - -\set VERBOSITY terse \\ -- needed for output stability -do $$ -begin - for i in 1..3 loop - declare - x int; - y int := i; - r record; - c int8_tbl; - begin - if i = 1 then - x := 42; - r := row(i, i+1); - c := row(i, i+1); - end if; - raise notice 'x = %', x; - raise notice 'y = %', y; - raise notice 'r = %', r; - raise notice 'c = %', c; - end; - end loop; -end$$; -\set VERBOSITY default - -- Check handling of conflicts between plpgsql vars and table columns. set plpgsql.variable_conflict = error; |
