diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-11-13 13:30:14 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-11-13 13:30:14 +0900 |
commit | 94fec48516a77f219ab94890219d724b973e4674 (patch) | |
tree | 7ada3351cf9dfe61033adc3de1c4d3f58bae78ab /contrib/postgres_fdw/sql/postgres_fdw.sql | |
parent | 1379fd537f9fc7941c8acff8c879ce3636dbdb77 (diff) | |
download | postgresql-94fec48516a77f219ab94890219d724b973e4674.tar.gz postgresql-94fec48516a77f219ab94890219d724b973e4674.zip |
Add regression test for two-phase transaction in postgres_fdw
postgres_fdw does not support two-phase transactions, so let's add a
small negative test case to check after it. Note that this is checked
using an end-of-xact callback to ensure a proper connection cleanup with
the foreign server, which is called before checking if a server is able
to handle 2PC with max_prepared_xacts, so this test does not need an
alternate output file.
Author: Gilles Darold
Discussion: https://postgr.es/m/20191108090507.GC1768@paquier.xyz
Diffstat (limited to 'contrib/postgres_fdw/sql/postgres_fdw.sql')
-rw-r--r-- | contrib/postgres_fdw/sql/postgres_fdw.sql | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql index 630b803e262..1c5c37b783e 100644 --- a/contrib/postgres_fdw/sql/postgres_fdw.sql +++ b/contrib/postgres_fdw/sql/postgres_fdw.sql @@ -2479,3 +2479,10 @@ SELECT b, avg(a), max(a), count(*) FROM pagg_tab GROUP BY b HAVING sum(a) < 700 -- Clean-up RESET enable_partitionwise_aggregate; + +-- Two-phase transactions are not supported. +BEGIN; +SELECT count(*) FROM ft1; +-- error here +PREPARE TRANSACTION 'fdw_tpc'; +ROLLBACK; |