postgresql/src/test
Álvaro Herrera cc733ed164
Avoid bogus scans of partitions when validating FKs to partitioned tables
Validating an unvalidated foreign key that references a partitioned
table would try to queue validations for each individual partition of
the referenced table, but this is wrong: each individual partition would
not necessarily have all the referenced rows, so errors would be raised.
Avoid doing that.  The pg_constraint rows that cause this to happen are
only there to support the action triggers that implement the DELETE/
UPDATE actions of the FK, so no validating scan is necessary.

This was an oversight in commit b663b9436e.

An equivalent oversight exists for NOT ENFORCED constraints, which is
not fixed in this commit.

Author: Amul Sul <sulamul@gmail.com>
Reported-by: Antonin Houska <ah@cybertec.at>
Reviewed-by: jian he <jian.universality@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Discussion: https://postgr.es/m/26983.1748418675@localhost
2025-06-05 17:17:13 +02:00
..
authentication Replace deprecated log_connections values in docs and tests 2025-05-22 17:14:54 -04:00
examples libpq: Deprecate pg_int64. 2025-03-25 21:40:00 +13:00
icu Update copyright for 2025 2025-01-01 11:21:55 -05:00
isolation Change the names generated for child foreign key constraints. 2025-04-23 12:03:02 -04:00
kerberos Replace deprecated log_connections values in docs and tests 2025-05-22 17:14:54 -04:00
ldap Replace deprecated log_connections values in docs and tests 2025-05-22 17:14:54 -04:00
locale Update copyright for 2025 2025-01-01 11:21:55 -05:00
mb
modules oauth: Limit JSON parsing depth in the client 2025-05-23 13:05:33 -07:00
perl Fix cross-version upgrade test failure 2025-05-20 10:39:14 +03:00
postmaster Replace deprecated log_connections values in docs and tests 2025-05-22 17:14:54 -04:00
recovery Replace deprecated log_connections values in docs and tests 2025-05-22 17:14:54 -04:00
regress Avoid bogus scans of partitions when validating FKs to partitioned tables 2025-06-05 17:17:13 +02:00
ssl Replace deprecated log_connections values in docs and tests 2025-05-22 17:14:54 -04:00
subscription Fix race condition in subscription TAP test 021_twophase 2025-05-26 17:28:37 +09:00
Makefile Add PG_TEST_EXTRA configure option to the Make builds 2024-11-04 14:09:38 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05: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