postgresql/src/test
Dean Rasheed fe9e658f4d Ensure that MERGE recomputes GENERATED expressions properly.
This fixes a bug that, under some circumstances, would cause MERGE to
fail to properly recompute expressions for GENERATED STORED columns.

Formerly, ExecInitModifyTable() did not call ExecInitStoredGenerated()
for a MERGE command, which meant that the generated expressions
information was not computed until later, when the first merge action
was executed. However, if the first merge action to execute was an
UPDATE, then ExecInitStoredGenerated() could decide to skip some some
generated columns, if the columns on which they depended were not
updated, which was a problem if the MERGE also contained an INSERT
action, for which no generated columns should be skipped.

So fix by having ExecInitModifyTable() call ExecInitStoredGenerated()
for MERGE, and assume that it isn't safe to skip any generated columns
in a MERGE. Possibly that could be relaxed, by allowing some generated
columns to be skipped for a MERGE without an INSERT action, but it's
not clear that it's worth the effort.

Noticed while investigating bug #17759. Back-patch to v15, where MERGE
was added.

Dean Rasheed, reviewed by Tom Lane.

Discussion:
  https://postgr.es/m/17759-e76d9bece1b5421c%40postgresql.org
  https://postgr.es/m/CAEZATCXb_ezoMCcL0tzKwRGA1x0oeE%3DawTaysRfTPq%2B3wNJn8g%40mail.gmail.com
2023-01-30 10:04:57 +00:00
..
authentication Support the same patterns for pg-user in pg_ident.conf as in pg_hba.conf 2023-01-20 11:21:55 +09:00
examples Update copyright for 2023 2023-01-02 15:00:37 -05:00
icu Update copyright for 2023 2023-01-02 15:00:37 -05:00
isolation Fix MAINTAIN privileges for toast tables and partitions. 2023-01-14 00:16:23 -08:00
kerberos Update copyright for 2023 2023-01-02 15:00:37 -05:00
ldap Add a test using ldapbindpasswd in pg_hba.conf 2023-01-23 08:40:18 -05:00
locale Update copyright for 2023 2023-01-02 15:00:37 -05:00
mb
modules meson: Add two missing regress tests 2023-01-17 13:49:09 -08:00
perl Fix AdjustUpgrade.pm's view conversion list for --with-lz4. 2023-01-18 16:51:40 -05:00
recovery Update copyright for 2023 2023-01-02 15:00:37 -05:00
regress Ensure that MERGE recomputes GENERATED expressions properly. 2023-01-30 10:04:57 +00:00
ssl Fix typos in comments, code and documentation 2023-01-03 16:26:14 +09:00
subscription Rename GUC logical_decoding_mode to logical_replication_mode. 2023-01-30 08:02:08 +05:30
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

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