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

Commit0cc31cc

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 parent1016549 commit0cc31cc

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
@@ -720,17 +720,17 @@ pgfdw_xact_callback(XactEvent event, void *arg)
720720
caseXACT_EVENT_PRE_PREPARE:
721721

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,12 @@
483483
COMMITTED</literal> local transaction. A future
484484
<productname>PostgreSQL</productname> release might modify these rules.
485485
</para>
486+
487+
<para>
488+
Note that it is currently not supported by
489+
<filename>postgres_fdw</filename> to prepare the remote transaction for
490+
two-phase commit.
491+
</para>
486492
</sect2>
487493

488494
<sect2>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp