Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0c7a28a

Browse files
author
Etsuro Fujita
committed
postgres_fdw: Fix error message for PREPARE TRANSACTION.
Currently, postgres_fdw does not support preparing a remote transactionfor two-phase commit even in the case where the remote transaction isread-only, but the old error message appeared to imply that that was notsupported only if the remote transaction modified remote tables. Changethe message so as to include the case where the remote transaction isread-only.Also fix a comment above the message.Also add a note about the lack of supporting PREPARE TRANSACTION to thepostgres_fdw documentation.Reported-by: Gilles DaroldAuthor: Gilles Darold and Etsuro FujitaReviewed-by: Michael Paquier and Kyotaro HoriguchiBackpatch-through: 9.4Discussion:https://postgr.es/m/08600ed3-3084-be70-65ba-279ab19618a5%40darold.net
1 parent5292570 commit0c7a28a

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

‎contrib/postgres_fdw/connection.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,17 +719,17 @@ pgfdw_xact_callback(XactEvent event, void *arg)
719719
caseXACT_EVENT_PRE_PREPARE:
720720

721721
/*
722-
* We disallow remote transactions that modified anything,
723-
*since it's notvery reasonable to hold them open until
724-
*the preparedtransaction is committed. For the moment,
725-
*throw errorunconditionally; later we might allow
726-
*read-only cases.Note that the error will cause us to
727-
*come right backhere with event == XACT_EVENT_ABORT, so
728-
*we'll clean upthe connection state at that point.
722+
* We disallowanyremote transactions, since it's not
723+
* very reasonable to hold them open until the prepared
724+
* transaction is committed. For the moment, throw error
725+
* unconditionally; later we might allow read-only cases.
726+
* Note that the error will cause us to come right back
727+
* here with event == XACT_EVENT_ABORT, so we'll clean up
728+
* the connection state at that point.
729729
*/
730730
ereport(ERROR,
731731
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
732-
errmsg("cannotprepare a transaction thatmodified remote tables")));
732+
errmsg("cannotPREPARE a transaction thathas operated on postgres_fdw foreign tables")));
733733
break;
734734
caseXACT_EVENT_PARALLEL_COMMIT:
735735
caseXACT_EVENT_COMMIT:

‎doc/src/sgml/postgres-fdw.sgml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,12 @@
478478
COMMITTED</> local transaction. A future
479479
<productname>PostgreSQL</productname> release might modify these rules.
480480
</para>
481+
482+
<para>
483+
Note that it is currently not supported by
484+
<filename>postgres_fdw</filename> to prepare the remote transaction for
485+
two-phase commit.
486+
</para>
481487
</sect2>
482488

483489
<sect2>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp