Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.
Gilles DAROLD <gilles@darold.net>
From: Gilles Darold <gilles@darold.net>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2019-11-05T11:41:41Z
Lists: pgsql-hackers
Attachments
- fix_postgres_fdw_prepared_transaction-v3.diff (text/x-patch) patch v3
Hi Esturo, Le 05/11/2019 à 10:35, Etsuro Fujita a écrit : > Hi Gilles, > > On Sat, Nov 2, 2019 at 1:29 AM Gilles Darold <gilles@darold.net> wrote: >> As per the following code, t1 is a remote table through postgres_fdw: >> test=# BEGIN; >> BEGIN >> test=# SELECT * FROM t1; >> ... >> >> test=# PREPARE TRANSACTION 'gxid1'; >> ERROR: cannot prepare a transaction that modified remote tables >> I have attached a patch to the documentation that adds remote tables to the list of objects where any operation prevent using a prepared transaction, currently it is just notified "operations involving temporary tables or the session's temporary namespace". > I'm not sure that's a good idea because file_fdw works well for > PREPARE TRANSACTION! How about adding a note about that to the > section of Transaction Management in the postgres_fdw documentation > like the attached? You are right, read only FDW can be used. A second point in favor of your remark is that this is the responsibility of the FDW implementation to throw an error when used with a prepared transaction and I see that this is not the case for all FDW. I have attached a single patch that include Etsuro Fujita's patch on postgres_fdw documentation and mine on postgres_fdw error message with the precision that it comes from postgres_fdw. The modification about prepared transaction in PostgreSQL documentation has been removed. -- Gilles Darold
Commits
-
Add regression test for two-phase transaction in postgres_fdw
- 94fec48516a7 13.0 landed
-
postgres_fdw: Fix error message for PREPARE TRANSACTION.
- 1bd67d535843 9.4.25 landed
- b260ce9c19b6 9.5.20 landed
- bca0aed2d01c 9.6.16 landed
- 0c7a28a5eabd 10.11 landed
- 042e82cef949 11.6 landed
- 0cc31cc32da0 12.1 landed
- 879c11761571 13.0 landed