From f64ea6dc5c8ccaec9a3d3d39695ca261febb6883 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Tue, 30 Mar 2021 10:34:43 +0530 Subject: Add a xid argument to the filter_prepare callback for output plugins. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Along with gid, this provides a different way to identify the transaction. The users that use xid in some way to prepare the transactions can use it to filter prepare transactions. The later commands COMMIT PREPARED or ROLLBACK PREPARED carries both identifiers, providing an output plugin the choice of what to use. Author: Markus Wanner Reviewed-by: Vignesh C, Amit Kapila Discussion: https://postgr.es/m/ee280000-7355-c4dc-e47b-2436e7be959c@enterprisedb.com --- contrib/test_decoding/test_decoding.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib/test_decoding/test_decoding.c') diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c index ae5f397f351..de1b6926581 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -77,6 +77,7 @@ static void pg_decode_message(LogicalDecodingContext *ctx, bool transactional, const char *prefix, Size sz, const char *message); static bool pg_decode_filter_prepare(LogicalDecodingContext *ctx, + TransactionId xid, const char *gid); static void pg_decode_begin_prepare_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn); @@ -440,7 +441,8 @@ pg_decode_rollback_prepared_txn(LogicalDecodingContext *ctx, * substring, then we filter it out. */ static bool -pg_decode_filter_prepare(LogicalDecodingContext *ctx, const char *gid) +pg_decode_filter_prepare(LogicalDecodingContext *ctx, TransactionId xid, + const char *gid) { if (strstr(gid, "_nodecode") != NULL) return true; -- cgit v1.2.3