postgresql/src/test
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
..
authentication Doc: improve README files associated with TAP tests. 2021-10-31 18:12:44 -04:00
examples libpq: Remove deprecated connection parameters authtype and tty 2021-03-09 15:01:22 +01:00
isolation Rename debug_invalidate_system_caches_always to debug_discard_caches. 2021-07-13 15:01:01 -04:00
kerberos Doc: improve README files associated with TAP tests. 2021-10-31 18:12:44 -04:00
ldap Doc: improve README files associated with TAP tests. 2021-10-31 18:12:44 -04:00
locale Remove extraneous newlines added by perl copyright patch 2021-05-07 11:37:37 -04:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Move Perl test modules to a better namespace 2021-10-24 10:28:19 -04:00
perl Document PG_TEST_NOCLEAN in TAP test README 2021-11-12 21:38:10 +01:00
recovery Fix instability in 026_overwrite_contrecord.pl test. 2021-11-09 18:40:19 -05:00
regress Fix display of SQL-standard function's arguments in INSERT/SELECT. 2021-11-17 11:31:31 -05:00
ssl Doc: improve README files associated with TAP tests. 2021-10-31 18:12:44 -04:00
subscription Invalidate relcache when changing REPLICA IDENTITY index. 2021-11-16 08:10:13 +05:30
Makefile Revert per-index collation version tracking feature. 2021-05-07 21:10:11 +12:00
README Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

authentication/
  Tests for authentication (but see also below)

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

kerberos/
  Tests for Kerberos/GSSAPI authentication and encryption

ldap/
  Tests for LDAP-based authentication

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

subscription/
  Tests for logical replication