Subject: [PATCH 9/9] reuse existing variable by overwriting it

From: Álvaro Herrera <[email-masked]>
Date: Thu, 12 Mar 2026 16:14:59 +0100

---
 src/backend/replication/pgoutput_repack/pgoutput_repack.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index c77564c4024..67442d07ab1 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -250,12 +250,8 @@ store_change(LogicalDecodingContext *ctx, Relation relation,
 	/* ... and the attributes themselves, if any */
 	foreach_ptr(varlena, attr_val, attrs_ext)
 	{
-		varlena    *ext_val;
-		Size		ext_val_size;
-
-		ext_val = detoast_external_attr(attr_val);
-		ext_val_size = VARSIZE_ANY(ext_val);
-		BufFileWrite(file, ext_val, ext_val_size);
+		attr_val = detoast_external_attr(attr_val);
+		BufFileWrite(file, attr_val, VARSIZE_ANY(attr_val));
 	}
 
 	/* Finally write the tuple size ... */
-- 
2.47.3

--pnppmxqkefjd4hu2--