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.1514605...@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f9263006d871d127794a402a7bef713fdd882156

Modified Files
--------------
src/pl/plpgsql/src/Makefile                      |   3 +-
src/pl/plpgsql/src/expected/plpgsql_varprops.out | 300 +++++++++++++++++++++++
src/pl/plpgsql/src/pl_comp.c                     |  17 +-
src/pl/plpgsql/src/pl_exec.c                     |  72 ++++--
src/pl/plpgsql/src/pl_funcs.c                    |  15 ++
src/pl/plpgsql/src/pl_gram.y                     |  75 +++---
src/pl/plpgsql/src/plpgsql.h                     |  27 +-
src/pl/plpgsql/src/sql/plpgsql_varprops.sql      | 249 +++++++++++++++++++
src/test/regress/expected/plpgsql.out            |  36 ---
src/test/regress/sql/plpgsql.sql                 |  26 --
10 files changed, 686 insertions(+), 134 deletions(-)

Reply via email to