avoid-use-scoped-block-variable-walsender.patch

application/octet-stream

Filename: avoid-use-scoped-block-variable-walsender.patch
Type: application/octet-stream
Part: 2
Message: Avoid use scoped block variable

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/replication/walsender.c 1 2
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 0564c99550..74a5f9622f 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -488,6 +488,7 @@ ReadReplicationSlot(ReadReplicationSlotCmd *cmd)
 	TupleDesc	tupdesc;
 	Datum		values[READ_REPLICATION_SLOT_COLS] = {0};
 	bool		nulls[READ_REPLICATION_SLOT_COLS];
+	char		xloc[64];
 
 	tupdesc = CreateTemplateTupleDesc(READ_REPLICATION_SLOT_COLS);
 	TupleDescInitBuiltinEntry(tupdesc, (AttrNumber) 1, "slot_type",
@@ -531,8 +532,6 @@ ReadReplicationSlot(ReadReplicationSlotCmd *cmd)
 		/* start LSN */
 		if (XLogRecPtrIsValid(slot_contents.data.restart_lsn))
 		{
-			char		xloc[64];
-
 			snprintf(xloc, sizeof(xloc), "%X/%08X",
 					 LSN_FORMAT_ARGS(slot_contents.data.restart_lsn));
 			values[i] = CStringGetTextDatum(xloc);