Test are in files named NNNNN_A_*.  They are run in lexically sorted order.

The "A" in the name is one of:

  s   The test succeeds in altering the state of the database
  e   The test produces an error, and database state is unaltered
  n   The test does not alter database state

The database state established by earlier tests is used in later tests.

Note that sequence values can always be affected, for values "s" and
"e".  The "n" tests take special care to reset sequences to their
initial state.

The test/unsupported/ directory contains tests that the current
regression testing system cannot support.  This is because the output
necessarily contains timestamps containing the current time, which
necessarily differ when comparing the results of different test runs.


In the FWIW category, this is the logic, at present, behind the
numbering of the tests:

The tests start by testing per-table, with gaps in the sequence
between tables.  The tables that hold foreign keys used in other
tables are tested before the tables that use the keys.  The successful
inserts are left in place for use by later tests.  Within any one
table, an insert is first attempted, then tests of each of the columns
in the order in which they are defined in CREATE TABLE.  Then tests of
inter-column interaction within the one table.

Then there is a gap and testing of inter-table interactions.

Then another gap, all generated ISOK_RESULTS are deleted and the
ISOK_RESULTS sequence reset, and the functions are tested.  First, the
action of the function on columns is tested.  Then a gap and
exceptions are tested.  Then a gap and and testing of what happens
when saved queries generate invalid results.


Developing:

Making almost any change to run_isok_queries() breaks all the tests
that test for errors raised, because the line number of the errors
will change.

To fix this:

Resolve all testing problems without disabling anything.

For each combination of disabling:

Make and install a disabled version.

# Delete the patch file
test/disable_$x/adjust_linenos.patch

Run `make DISABLE_$x=y installcheck` and check that all the
test failures are due to line number offsets.

# Delete the actual results to get rid of any leftover cruft
rm -rf results

# Run the regression test
make DISABLE_$x=y installcheck

# Save the expected output
mv test/disable_$x/expected test/disable_$x/old_expected

# Put the actual output as the expected output
mv results test/disable_$x/expected

# Make a new diff
diff -ru test/disable_$x/old_expected test/disable_$x/expected \
  > test/disable_$x/adjust_linenos.patch

# Test that it works
make DISABLE_$x installcheck


Then, switch to PGv12, do the same thing, but also do it without
disabling anything.  Save the patch in
test/version/12/disable_$x.patch

To install and run regression tests against an old version (depending
on where you installed the old version, with ./configure --prefix=...):

  make PG_CONFIG=/home/me/projects/postgresql/local/bin/pg_config install

  make PG_CONFIG=/home/me/projects/postgresql/local/bin/pg_config installcheck
