From 8da5bcb281868f5b4c603bdc4a6f9d81fb32bfe0 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Tue, 13 Jul 2021 10:59:23 +1000 Subject: [PATCH v18] tmp - the RelationSynEntry "qual" is redundant. Now that the exprstate member is introduce the other qual member is not longer needed. All code using it can be removed. --- src/backend/replication/pgoutput/pgoutput.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 352dd4c..cdf1521 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -108,7 +108,6 @@ typedef struct RelationSyncEntry bool replicate_valid; PublicationActions pubactions; - List *qual; /* row filter */ List *exprstate; /* ExprState for row filter */ TupleTableSlot *scantuple; /* tuple table slot for row filter */ @@ -640,7 +639,7 @@ pgoutput_row_filter(Relation relation, HeapTuple oldtuple, HeapTuple newtuple, R bool result = true; /* Bail out if there is no row filter */ - if (entry->qual == NIL) + if (entry->exprstate == NIL) return true; elog(DEBUG3, "table \"%s.%s\" has row filter", @@ -1218,7 +1217,6 @@ get_rel_sync_entry(PGOutputData *data, Relation relation) entry->replicate_valid = false; entry->pubactions.pubinsert = entry->pubactions.pubupdate = entry->pubactions.pubdelete = entry->pubactions.pubtruncate = false; - entry->qual = NIL; entry->scantuple = NULL; entry->exprstate = NIL; entry->publish_as_relid = InvalidOid; @@ -1353,7 +1351,6 @@ get_rel_sync_entry(PGOutputData *data, Relation relation) oldctx = MemoryContextSwitchTo(CacheMemoryContext); rfnode = stringToNode(TextDatumGetCString(rfdatum)); - entry->qual = lappend(entry->qual, rfnode); /* Prepare for expression execution */ exprstate = pgoutput_row_filter_init_expr(rfnode); @@ -1510,10 +1507,6 @@ rel_sync_cache_publication_cb(Datum arg, int cacheid, uint32 hashvalue) entry->pubactions.pubdelete = false; entry->pubactions.pubtruncate = false; - if (entry->qual != NIL) - list_free_deep(entry->qual); - entry->qual = NIL; - if (entry->exprstate != NIL) list_free_deep(entry->exprstate); entry->exprstate = NIL; -- 1.8.3.1