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

application/octet-stream

Filename: avoid-use-scoped-block-variable-rawpage.patch
Type: application/octet-stream
Part: 1
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+
contrib/pageinspect/rawpage.c 1 2
diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c
index aef442b5db..26c23c28f5 100644
--- a/contrib/pageinspect/rawpage.c
+++ b/contrib/pageinspect/rawpage.c
@@ -260,6 +260,7 @@ page_header(PG_FUNCTION_ARGS)
 	Page		page;
 	PageHeader	pageheader;
 	XLogRecPtr	lsn;
+	char		lsnchar[64];
 
 	if (!superuser())
 		ereport(ERROR,
@@ -280,8 +281,6 @@ page_header(PG_FUNCTION_ARGS)
 	/* pageinspect >= 1.2 uses pg_lsn instead of text for the LSN field. */
 	if (TupleDescAttr(tupdesc, 0)->atttypid == TEXTOID)
 	{
-		char		lsnchar[64];
-
 		snprintf(lsnchar, sizeof(lsnchar), "%X/%08X", LSN_FORMAT_ARGS(lsn));
 		values[0] = CStringGetTextDatum(lsnchar);
 	}