postgresql/src/test
Dean Rasheed 2605643a3a Fix DEFAULT handling for multi-row INSERT rules.
When updating a relation with a rule whose action performed an INSERT
from a multi-row VALUES list, the rewriter might skip processing the
VALUES list, and therefore fail to replace any DEFAULTs in it. This
would lead to an "unrecognized node type" error.

The reason was that RewriteQuery() assumed that a query doing an
INSERT from a multi-row VALUES list would necessarily only have one
item in its fromlist, pointing to the VALUES RTE to read from. That
assumption is correct for the original query, but not for product
queries produced for rule actions. In such cases, there may be
multiple items in the fromlist, possibly including multiple VALUES
RTEs.

What is required instead is for RewriteQuery() to skip any RTEs from
the product query's originating query, which might include one or more
already-processed VALUES RTEs. What's left should then include at most
one VALUES RTE (from the rule action) to be processed.

Patch by me. Thanks to Tom Lane for reviewing.

Back-patch to all supported branches.

Discussion: https://postgr.es/m/CAEZATCV39OOW7LAR_Xq4i%2BLc1Byux%3DeK3Q%3DHD_pF1o9LBt%3DphA%40mail.gmail.com
2022-12-03 12:11:33 +00:00
..
authentication Add TAP tests for include directives in HBA end ident files 2022-11-28 15:19:06 +09:00
examples Remove configure probe for sys/select.h. 2022-08-14 00:09:47 +12:00
icu meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
isolation Make materialized views participate in predicate locking 2022-12-01 15:41:13 +09:00
kerberos Introduce SYSTEM_USER 2022-09-29 15:05:40 +09:00
ldap Make finding openssl program a configure or meson option 2022-10-20 21:05:42 +02:00
locale pycodestyle (PEP 8) cleanup in Python scripts 2022-03-09 10:54:20 +01:00
mb
modules Remove logic for converting a table to a view. 2022-12-02 12:14:32 -05:00
perl Fix perl warning from commit 9b4eafcaf4 2022-11-23 07:03:06 -05:00
recovery If wait_for_catchup fails under has_wal_read_bug, skip balance of test. 2022-11-12 11:19:50 -08:00
regress Fix DEFAULT handling for multi-row INSERT rules. 2022-12-03 12:11:33 +00:00
ssl Make finding openssl program a configure or meson option 2022-10-20 21:05:42 +02:00
subscription Fix incorrect output from pgoutput when using column lists. 2022-12-02 10:52:58 +05:30
Makefile Refactor PG_TEST_EXTRA logic in autoconf build 2022-09-20 11:24:16 -07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
README

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