postgresql/src/test
Alvaro Herrera 71a05b2232 Don't mark partitioned indexes invalid unnecessarily
When an indexes is created on a partitioned table using ONLY (don't
recurse to partitions), it gets marked invalid until index partitions
are attached for each table partition.  But there's no reason to do this
if there are no partitions ... and moreover, there's no way to get the
index to become valid afterwards, because all partitions that get
created/attached get their own index partition already attached to the
parent index, so there's no chance to do ALTER INDEX ... ATTACH PARTITION
that would make the parent index valid.

Fix by not marking the index as invalid to begin with.

This is very similar to 9139aa1942, but the pg_dump aspect does not
appear to be relevant until we add FKs that can point to PKs on
partitioned tables.  (I tried to cause the pg_upgrade test to break by
leaving some of these bogus tables around, but wasn't able to.)

Making this change means that an index that was supposed to be invalid
in the insert_conflict regression test is no longer invalid; reorder the
DDL so that the test continues to verify the behavior we want it to.

Author: Álvaro Herrera
Reviewed-by: Amit Langote
Discussion: https://postgr.es/m/20181203225019.2vvdef2ybnkxt364@alvherre.pgsql
2018-12-05 13:31:51 -03:00
..
authentication Clarify the README files for the various separate TAP-based test suites. 2018-06-19 19:30:50 -04:00
examples Fix spelling errors and typos in comments 2018-11-02 13:56:52 +01:00
isolation Add some missing schema qualifications 2018-12-03 14:21:52 +09:00
kerberos Make "kerberos" test suite independent of "localhost" name resolution. 2018-08-03 20:53:25 -07:00
ldap Fix handling of HBA ldapserver with multiple hostnames. 2018-11-13 17:46:28 +13:00
locale Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:51:08 -08:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Add PGXS options to control TAP and isolation tests, take two 2018-12-03 09:27:35 +09:00
perl Integrate recovery.conf into postgresql.conf 2018-11-25 16:33:40 +01:00
recovery Only allow one recovery target setting 2018-11-28 13:55:54 +01:00
regress Don't mark partitioned indexes invalid unnecessarily 2018-12-05 13:31:51 -03:00
ssl Update ssl test certificates and keys 2018-11-27 15:16:14 +01:00
subscription Fix spelling errors and typos in comments 2018-11-02 13:56:52 +01:00
thread Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
Makefile Revert "Allow on-line enabling and disabling of data checksums" 2018-04-09 19:03:42 +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