postgresql/src/test
Tom Lane c402b02b9f Fix old bug with coercing the result of a COLLATE expression.
There are hacks in parse_coerce.c to push down a requested coercion
to below any CollateExpr that may appear.  However, we did that even
if the requested data type is non-collatable, leading to an invalid
expression tree in which CollateExpr is applied to a non-collatable
type.  The fix is just to drop the CollateExpr altogether, reasoning
that it's useless.

This bug is ten years old, dating to the original addition of
COLLATE support.  The lack of field complaints suggests that there
aren't a lot of user-visible consequences.  We noticed the problem
because it would trigger an assertion in DefineVirtualRelation if
the invalid structure appears as an output column of a view; however,
in a non-assert build, you don't see a crash just a (subtly incorrect)
complaint about applying collation to a non-collatable type.  I found
that by putting the incorrect structure further down in a view, I could
make a view definition that would fail dump/reload, per the added
regression test case.  But CollateExpr doesn't do anything at run-time,
so this likely doesn't lead to any really exciting consequences.

Per report from Yulin Pei.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/HK0PR01MB22744393C474D503E16C8509F4709@HK0PR01MB2274.apcprd01.prod.exchangelabs.com
2021-04-12 14:37:49 -04:00
..
authentication Add some information about authenticated identity via log_connections 2021-04-07 10:16:39 +09:00
examples libpq: Remove deprecated connection parameters authtype and tty 2021-03-09 15:01:22 +01:00
isolation ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
kerberos Add some information about authenticated identity via log_connections 2021-04-07 10:16:39 +09:00
ldap Add some information about authenticated identity via log_connections 2021-04-07 10:16:39 +09:00
locale Clean up after tests in src/test/locale/. 2020-11-28 16:08:36 -05:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Suppress length of Notice/Error msgs in PQtrace regress mode 2021-04-09 17:13:18 -04:00
perl Fix some failures with connection tests on Windows hosts 2021-04-08 06:55:00 +09:00
recovery Fix test added by commit 9de9294b0c. 2021-04-07 07:42:36 +09:00
regress Fix old bug with coercing the result of a COLLATE expression. 2021-04-12 14:37:49 -04:00
ssl Remove channel binding requirement from clientcert=verify-full test. 2021-04-07 12:50:17 -04:00
subscription Fix the tests added by commit ac4645c015. 2021-04-06 14:58:52 +05:30
Makefile Introduce --with-ssl={openssl} as a configure option 2021-02-01 19:19:44 +09: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