On 12/20/19 1:54 AM, Andreas Karlsson wrote:
On 12/20/19 1:01 AM, Ranier Vilela wrote:> First case:
Third case:
\ src \ backend \ utils \ cache \ relcache.c (line 5190)
if (relation-> rd_pubactions)

It will never be executed, because if relation-> rd_pubactions is true, the function returns on line 5154.

I have not looked into this one in detail, but the free at line 5192 looks like potentially dead code.

I have looked at it now and it seems like this code has been dead since the function was originally implemented in 665d1fad99e.

Peter, what do you think?

Andreas
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 50f8912c13..1ae41f776d 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -5187,12 +5187,6 @@ GetRelationPublicationActions(Relation relation)
 			break;
 	}
 
-	if (relation->rd_pubactions)
-	{
-		pfree(relation->rd_pubactions);
-		relation->rd_pubactions = NULL;
-	}
-
 	/* Now save copy of the actions in the relcache entry. */
 	oldcxt = MemoryContextSwitchTo(CacheMemoryContext);
 	relation->rd_pubactions = palloc(sizeof(PublicationActions));

Reply via email to