postgresql/src/test
Tom Lane d98e27dc6e Ensure that expandTableLikeClause() re-examines the same table.
As it stood, expandTableLikeClause() re-did the same relation_openrv
call that transformTableLikeClause() had done.  However there are
scenarios where this would not find the same table as expected.
We hold lock on the LIKE source table, so it can't be renamed or
dropped, but another table could appear before it in the search path.
This explains the odd behavior reported in bug #16758 when cloning a
table as a temp table of the same name.  This case worked as expected
before commit 502898192 introduced the need to open the source table
twice, so we should fix it.

To make really sure we get the same table, let's re-open it by OID not
name.  That requires adding an OID field to struct TableLikeClause,
which is a little nervous-making from an ABI standpoint, but as long
as it's at the end I don't think there's any serious risk.

Per bug #16758 from Marc Boeren.  Like the previous patch,
back-patch to all supported branches.

Discussion: https://postgr.es/m/16758-840e84a6cfab276d@postgresql.org
2020-12-01 14:02:28 -05:00
..
authentication Make new authentication test case more robust. 2020-09-04 21:01:59 -04:00
examples Client-side fixes for delayed NOTIFY receipt. 2018-10-19 22:22:57 -04:00
isolation Avoid update conflict out serialization anomalies. 2020-06-11 10:09:37 -07:00
locale Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:51:15 -08:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Rethink recent fix for pg_dump's handling of extension config tables. 2020-10-07 12:51:05 -04:00
perl Use fast checkpoint in PostgresNode::backup() 2020-10-21 14:37:25 -03:00
recovery Fix race in test of pg_switch_wal(). 2020-09-13 23:13:44 -07:00
regress Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:28 -05:00
ssl Fix searchpath and module location for pg_rewind and ssl TAP tests 2019-02-07 11:10:06 -05:00
subscription Empty search_path in logical replication apply worker and walsender. 2020-08-10 09:22:59 -07:00
thread Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
Makefile Add TAP tests for password-based authentication methods. 2017-03-17 11:34:16 +02:00
README Add TAP tests for password-based authentication methods. 2017-03-17 11:34:16 +02: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

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

isolation/
  Tests for concurrent behavior at the SQL level

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

thread/
  A thread-safety-testing utility used by configure