postgresql/src/test
Alexander Korotkov e64a9ba2b4 Reject degenerate SPLIT PARTITION with DEFAULT partition
ALTER TABLE ... SPLIT PARTITION allows a DEFAULT partition to be created
as one of the replacement partitions when the parent table does not
already have one.  However, it should not allow the degenerate case where
a non-DEFAULT partition keeps exactly the same bound as the split
partition and the command merely adds a DEFAULT partition through the
SPLIT PARTITION path.

Detect that case by comparing the bound of the split partition with the
bound of the only non-DEFAULT replacement partition, and raise an error
when they are the same.  Users should add a DEFAULT partition directly
with CREATE TABLE ... PARTITION OF ... DEFAULT or ALTER TABLE ... ATTACH
PARTITION ... DEFAULT instead.

The comparison goes through the partition operator family rather than
byte equality so that values which are binary-different but compare
equal under the partition key's comparator are treated as the same
bound.  The corresponding regression test uses a float8 LIST partition
with -0.0 and 0.0 -- they have different bit patterns but are equal
under float8 -- to verify that a datumIsEqual()-based check would let
the degenerate split through while the partsupfunc-based check
correctly rejects it.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Discussion: https://postgr.es/m/C18878AB-DEB2-4A61-9995-A035DD644B81@gmail.com
2026-05-25 11:57:42 +03:00
..
authentication Pre-beta mechanical code beautification, step 2: run pgperltidy. 2026-05-13 10:37:42 -04:00
examples Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
icu Update copyright for 2026 2026-01-01 13:24:10 -05:00
isolation Use "concurrent delete" in serialization error for TM_Deleted cases 2026-05-01 10:00:29 +09:00
kerberos Update copyright for 2026 2026-01-01 13:24:10 -05:00
ldap Update copyright for 2026 2026-01-01 13:24:10 -05:00
locale Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
mb Remove MULE_INTERNAL encoding. 2026-04-08 17:40:06 +12:00
modules injection_points: Move some structs to new header injection_points.h 2026-05-18 11:11:40 +09:00
perl Pre-beta mechanical code beautification, step 2: run pgperltidy. 2026-05-13 10:37:42 -04:00
postmaster Pre-beta mechanical code beautification, step 2: run pgperltidy. 2026-05-13 10:37:42 -04:00
recovery Avoid exposing WAL receiver raw conninfo during timeline jumps 2026-05-23 08:10:07 +09:00
regress Reject degenerate SPLIT PARTITION with DEFAULT partition 2026-05-25 11:57:42 +03:00
ssl Pre-beta updates: run src/tools/copyright.pl. 2026-05-13 11:01:57 -04:00
subscription Pre-beta mechanical code beautification, step 2: run pgperltidy. 2026-05-13 10:37:42 -04:00
Makefile Split some long Makefile lists 2025-12-28 09:17:42 +09:00
meson.build Revert "Add built-in fuzzing harnesses for security testing." 2026-04-10 09:53:58 -04: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