postgres_fdw: ignore Greenplum's XACT_EVENT_PRE_PREPARE
Greenplum does that on QE, which is reasonable for a MPP system, but
please extensions don't panic.
@@ -729,17 +729,12 @@ pgfdw_xact_callback(XactEvent event, void *arg)
case XACT_EVENT_PRE_PREPARE:
/*
- * We disallow remote transactions that modified anything,
- * since it's not very reasonable to hold them open until
- * the prepared transaction is committed. For the moment,
- * throw error unconditionally; later we might allow
- * read-only cases. Note that the error will cause us to
- * come right back here with event == XACT_EVENT_ABORT, so
- * we'll clean up the connection state at that point.
+ * FDW update is not the same as Greenplum segments update,
+ * doesn't need the two-phase commit.
+ *
+ * Besides that, Greenplum prepares on many cases including
+ * DTX distributing for MPP usages, just break here.
*/
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot prepare a transaction that modified remote tables")));
break;
case XACT_EVENT_PARALLEL_COMMIT:
case XACT_EVENT_COMMIT:
