pgsql: In LDAP test, restart after pg_hba.conf changes

2018-02-13 Thread Peter Eisentraut
In LDAP test, restart after pg_hba.conf changes Instead of issuing a reload after pg_hba.conf changes between test cases, run a full restart. With a reload, an error in the new pg_hba.conf is ignored and the tests will continue to run with the old settings, invalidating the subsequent test cases.

pgsql: Add procedure support to pg_get_functiondef

2018-02-13 Thread Peter Eisentraut
Add procedure support to pg_get_functiondef This also makes procedures work in psql's \ef and \sf commands. Reported-by: Pavel Stehule Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7a32ac8a66903de8c352735f2a26f610f5e47090 Modified Files -- doc/src/s

pgsql: doc: pg_function_is_visible also applies to aggregates and proce

2018-02-13 Thread Peter Eisentraut
doc: pg_function_is_visible also applies to aggregates and procedures Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2ac3e6acc228e4b99022019379c6d5c4b61b231c Modified Files -- doc/src/sgml/func.sgml | 2 ++ 1 file changed, 2 insertions(+)

pgsql: Add tests for pg_get_functiondef

2018-02-13 Thread Peter Eisentraut
Add tests for pg_get_functiondef Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7cd56f218d0f8953999b944bc558cd6684b15cdc Modified Files -- src/test/regress/expected/create_function_3.out | 44 + src/test/regress/sql/create_functio

pgsql: Fix typo

2018-02-13 Thread Peter Eisentraut
Fix typo Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a7b8f0661d9ca9656ba58546ed871b36dbf8504d Modified Files -- src/test/regress/expected/create_function_3.out | 144 src/test/regress/sql/create_function_3.sql | 88 +

pgsql: Make plpgsql use its DTYPE_REC code paths for composite-type var

2018-02-13 Thread Tom Lane
Make plpgsql use its DTYPE_REC code paths for composite-type variables. Formerly, DTYPE_REC was used only for variables declared as "record"; variables of named composite types used DTYPE_ROW, which is faster for some purposes but much less flexible. In particular, the ROW code paths are entirely

pgsql: Speed up plpgsql function startup by doing fewer pallocs.

2018-02-13 Thread Tom Lane
Speed up plpgsql function startup by doing fewer pallocs. Previously, copy_plpgsql_datum did a separate palloc for each variable needing instance-local storage. In simple benchmarks this made for a noticeable fraction of the total runtime. Improve it by precalculating the space needed for all of

pgsql: Speed up plpgsql trigger startup by introducing "promises".

2018-02-13 Thread Tom Lane
Speed up plpgsql trigger startup by introducing "promises". Over the years we've accreted quite a few special variables that are predefined in plpgsql trigger functions. The cost of initializing these variables to their defined values turns out to be a significant part of the runtime of simple tr

pgsql: Support CONSTANT/NOT NULL/initial value for plpgsql composite va

2018-02-13 Thread Tom Lane
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