From a96a4b98e7eae4377da9879067fbcec9cb850dc2 Mon Sep 17 00:00:00 2001 From: Ajin Cherian Date: Thu, 26 Nov 2026 13:23:25 +1100 Subject: [PATCH v1 2/2] Close the relation opened in check_and_init_gencol() check_and_init_gencol() gets the relation with RelationIdGetRelation() but never calls RelationClose(), on either of its return paths, so each call leaves a relcache reference behind. The sibling function pgoutput_column_list_init() does close its relation. Add the missing RelationClose() calls. --- src/backend/replication/pgoutput/pgoutput.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 4cb36f6d075..eb868e0f80d 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -1087,6 +1087,7 @@ check_and_init_gencol(PGOutputData *data, List *publications, if (!gencolpresent) { entry->include_gencols_type = PUBLISH_GENCOLS_NONE; + RelationClose(relation); return; } @@ -1116,6 +1117,8 @@ check_and_init_gencol(PGOutputData *data, List *publications, get_namespace_name(RelationGetNamespace(relation)), RelationGetRelationName(relation))); } + + RelationClose(relation); } /* -- 2.47.3