postgresql/src/test
Tom Lane 680d540502 Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT.
If a query against an inheritance tree runs concurrently with an ALTER
TABLE that's disinheriting one of the tree members, it's possible to get
a "could not find inherited attribute" error because after obtaining lock
on the removed member, make_inh_translation_list sees that its columns
have attinhcount=0 and decides they aren't the columns it's looking for.

An ideal fix, perhaps, would avoid including such a just-removed member
table in the query at all; but there seems no way to accomplish that
without adding expensive catalog rechecks or creating a likelihood of
deadlocks.  Instead, let's just drop the check on attinhcount.  In this
way, a query that's included a just-disinherited child will still
succeed, which is not a completely unreasonable behavior.

This problem has existed for a long time, so back-patch to all supported
branches.  Also add an isolation test verifying related behaviors.

Patch by me; the new isolation test is based on Kyotaro Horiguchi's work.

Discussion: https://postgr.es/m/20170626.174612.23936762.horiguchi.kyotaro@lab.ntt.co.jp
2018-01-12 15:46:37 -05:00
..
authentication Update copyright for 2018 2018-01-02 23:30:12 -05:00
examples Update copyright for 2018 2018-01-02 23:30:12 -05:00
isolation Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT. 2018-01-12 15:46:37 -05:00
ldap Allow ldaps when using ldap authentication 2018-01-03 10:11:26 -05:00
locale Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:51:08 -08:00
mb
modules Update copyright for 2018 2018-01-02 23:30:12 -05:00
perl Refactor subscription tests to use PostgresNode's wait_for_catchup 2018-01-11 13:35:38 -05:00
recovery Update copyright for 2018 2018-01-02 23:30:12 -05:00
regress Fix incorrect handling of subquery pullup in the presence of grouping sets. 2018-01-12 12:24:50 -05:00
ssl Fix ssl tests for when tls-server-end-point is not supported 2018-01-09 12:28:49 -05:00
subscription Refactor subscription tests to use PostgresNode's wait_for_catchup 2018-01-11 13:35:38 -05:00
thread Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Add LDAP authentication test suite 2017-09-15 11:44:29 -04: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

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