postgresql/src/test
Tom Lane f3ab5d3a2d Allow adjusting session_authorization and role in parallel workers.
The code intends to allow GUCs to be set within parallel workers
via function SET clauses, but not otherwise.  However, doing so fails
for "session_authorization" and "role", because the assign hooks for
those attempt to set the subsidiary "is_superuser" GUC, and that call
falls foul of the "not otherwise" prohibition.  We can't switch to
using GUC_ACTION_SAVE for this, so instead add a new GUC variable
flag GUC_ALLOW_IN_PARALLEL to mark is_superuser as being safe to set
anyway.  (This is okay because is_superuser has context PGC_INTERNAL
and thus only hard-wired calls can change it.  We'd need more thought
before applying the flag to other GUCs; but maybe there are other
use-cases.)  This isn't the prettiest fix perhaps, but other
alternatives we thought of would be much more invasive.

While here, correct a thinko in commit 059de3ca4: when rejecting
a GUC setting within a parallel worker, we should return 0 not -1
if the ereport doesn't longjmp.  (This seems to have no consequences
right now because no caller cares, but it's inconsistent.)  Improve
the comments to try to forestall future confusion of the same kind.

Despite the lack of field complaints, this seems worth back-patching.
Thanks to Nathan Bossart for the idea to invent a new flag,
and for review.

Discussion: https://postgr.es/m/2833457.1723229039@sss.pgh.pa.us
2024-08-10 15:51:28 -04:00
..
authentication Refactor routine to find single log content pattern in TAP tests 2023-06-09 11:56:27 +09:00
examples Update copyright for 2023 2023-01-02 15:00:37 -05:00
icu initdb: change default --locale-provider back to libc. 2023-06-21 11:10:03 -07:00
isolation Remove configuration-dependent output from new inplace-inval test. 2024-06-28 09:33:43 -07:00
kerberos Don't clobber test exit code at cleanup in LDAP/Kerberors tests 2024-04-07 20:22:06 +03:00
ldap Don't clobber test exit code at cleanup in LDAP/Kerberors tests 2024-04-07 20:22:06 +03:00
locale Update copyright for 2023 2023-01-02 15:00:37 -05:00
mb
modules Clean out column-level pg_init_privs entries when dropping tables. 2024-06-14 16:20:35 -04:00
perl Choose ports for test servers less likely to result in conflicts 2024-07-08 11:40:58 -04:00
recovery Add accidentally omitted test to meson build file 2024-07-29 15:45:39 -04:00
regress Allow adjusting session_authorization and role in parallel workers. 2024-08-10 15:51:28 -04:00
ssl Force nodes for SSL tests to start in TCP mode 2024-07-08 11:40:58 -04:00
subscription Improve stability of subscription/029_on_error.pl 2024-05-24 11:21:27 +09:00
Makefile Refactor PG_TEST_EXTRA logic in autoconf build 2022-09-20 11:24:16 -07:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05: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