postgresql/src/test/regress
Tom Lane a8d8445a7b Fix display of SQL-standard function's arguments in INSERT/SELECT.
If a SQL-standard function body contains an INSERT ... SELECT statement,
any function parameters referenced within the SELECT were always printed
in $N style, rather than using the parameter name if any.  While not
strictly incorrect, this wasn't the intention, and it's inconsistent
with the way that such parameters would be printed in any other kind
of statement.

The cause is that the recursion to get_query_def from
get_insert_query_def neglected to pass down the context->namespaces
list, passing constant NIL instead.  This is a very ancient oversight,
but AFAICT it had no visible consequences before commit e717a9a18
added an outermost namespace with function parameters.  We don't allow
INSERT ... SELECT as a sub-query, except in a top-level WITH clause,
where it couldn't contain any outer references that might need to access
upper namespaces.  So although that's arguably a bug, I don't see any
point in changing it before v14.

In passing, harden the code added to get_parameter by e717a9a18 so that
it won't crash if a PARAM_EXTERN Param appears in an unexpected place.

Per report from Erki Eessaar.  Code fix by me, regression test case
by Masahiko Sawada.

Discussion: https://postgr.es/m/AM9PR01MB8268347BED344848555167FAFE949@AM9PR01MB8268.eurprd01.prod.exchangelabs.com
2021-11-17 11:31:31 -05:00
..
data Fix full text search to handle NOT above a phrase search correctly. 2020-04-27 12:21:04 -04:00
expected Fix display of SQL-standard function's arguments in INSERT/SELECT. 2021-11-17 11:31:31 -05:00
input Fix snapshot reference leak if lo_export fails. 2021-11-03 10:52:38 +02:00
output Update alternative expected output file. 2021-11-03 19:38:17 +02:00
sql Fix display of SQL-standard function's arguments in INSERT/SELECT. 2021-11-17 11:31:31 -05:00
.gitignore Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
GNUmakefile Avoid creating testtablespace directories where not wanted. 2021-05-19 14:04:01 -04:00
Makefile Fix non-GNU makefiles for AIX make. 2017-11-30 00:57:22 -08:00
parallel_schedule Don't overlook indexes during parallel VACUUM. 2021-11-02 12:06:17 -07:00
pg_regress_main.c Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00
pg_regress.c Move Perl test modules to a better namespace 2021-10-24 10:28:19 -04:00
pg_regress.h Allow pg_regress.c wrappers to postprocess test result files. 2021-01-11 13:43:19 -05:00
README
regress.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
regressplans.sh Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
resultmap Cygwin and Mingw floating-point fixes. 2019-02-16 01:50:16 +00:00
standby_schedule

Documentation concerning how to run these regression tests and interpret
the results can be found in the PostgreSQL manual, in the chapter
"Regression Tests".