From 1052871eb16b7644a028c05b7c017f2552e1116d Mon Sep 17 00:00:00 2001 From: gem install thin Date: Mon, 16 Nov 2015 16:16:25 +0600 Subject: [PATCH] Exclude non-selective relation using REPLICA IDENTITY NOTHING --- decoding_json.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/decoding_json.c b/decoding_json.c index 973afa7..b3a344f 100644 --- a/decoding_json.c +++ b/decoding_json.c @@ -255,8 +255,10 @@ static void pg_decode_change(LogicalDecodingContext* ctx, ReorderBufferTXN* txn, MemoryContextSwitchTo(old); MemoryContextReset(data->context); - - OutputPluginWrite(ctx, true); + + if (relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT ||relation->rd_rel->relreplident == REPLICA_IDENTITY_FULL || relation->rd_rel->relreplident == REPLICA_IDENTITY_INDEX) { + OutputPluginWrite(ctx, true); + } } /* adapted from test_decoding.c */