postgresql/src/test
Tom Lane 6f7eec1193 Show 'AS "?column?"' explicitly when it's important.
ruleutils.c was coded to suppress the AS label for a SELECT output
expression if the column name is "?column?", which is the parser's
fallback if it can't think of something better.  This is fine, and
avoids ugly clutter, so long as (1) nothing further up in the parse
tree relies on that column name or (2) the same fallback would be
assigned when the rule or view definition is reloaded.  Unfortunately
(2) is far from certain, both because ruleutils.c might print the
expression in a different form from how it was originally written
and because FigureColname's rules might change in future releases.
So we shouldn't rely on that.

Detecting exactly whether there is any outer-level use of a SELECT
column name would be rather expensive.  This patch takes the simpler
approach of just passing down a flag indicating whether there *could*
be any outer use; for example, the output column names of a SubLink
are not referenceable, and we also do not care about the names exposed
by the right-hand side of a setop.  This is sufficient to suppress
unwanted clutter in all but one case in the regression tests.  That
seems like reasonable evidence that it won't be too much in users'
faces, while still fixing the cases we need to fix.

Per bug #17486 from Nicolas Lutic.  This issue is ancient, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/17486-1ad6fd786728b8af@postgresql.org
2022-05-21 14:45:58 -04:00
..
authentication Add missing $Test::Builder::Level settings 2021-09-23 23:06:55 +02:00
examples libpq: Remove deprecated connection parameters authtype and tty 2021-03-09 15:01:22 +01:00
isolation Fix risk of deadlock failure while dropping a partitioned index. 2022-03-21 12:22:13 -04:00
kerberos Add more $Test::Builder::Level in the TAP tests 2021-10-12 11:16:20 +09:00
ldap Adapt src/test/ldap/t/001_auth.pl to work with openldap 2.5. 2021-10-19 11:15:45 -07:00
locale Remove extraneous newlines added by perl copyright patch 2021-05-07 11:37:37 -04:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Fix DDL deparse of CREATE OPERATOR CLASS 2022-05-20 18:52:55 +02:00
perl Backpatch addition of wait_for_log(), pump_until(). 2022-05-02 18:09:42 -07:00
recovery Disable 031_recovery_conflict.pl until after minor releases. 2022-05-08 18:06:19 -07:00
regress Show 'AS "?column?"' explicitly when it's important. 2022-05-21 14:45:58 -04:00
ssl Fix failures in SSL tests caused by out-of-tree keys and certificates 2022-03-22 13:21:33 +09:00
subscription Fix publish_as_relid with multiple publications 2022-03-16 18:06:27 +01:00
Makefile Revert per-index collation version tracking feature. 2021-05-07 21:10:11 +12:00
README Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -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 (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