aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-01-18 15:55:01 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-01-18 15:55:01 -0500
commit3fd80c728dc36fbd250ca3019c2f5fa2567f1a75 (patch)
tree5b2a84a2df6a1e7b2d8f4f5d5674f5702e18560e
parenta6cf3df4ebdcbc7857910a67f259705645383e9f (diff)
downloadpostgresql-3fd80c728dc36fbd250ca3019c2f5fa2567f1a75.tar.gz
postgresql-3fd80c728dc36fbd250ca3019c2f5fa2567f1a75.zip
Narrow the scope of a local variable.
This is better style and more symmetrical with the other if-branch. This likely should have been included in 9de77b545 (which created the opportunity), but it was overlooked. Japin Li Discussion: https://postgr.es/m/MEYP282MB16699FA4A7CD57EB250E871FB6A40@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
-rw-r--r--src/backend/replication/logical/proto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 62275ebabea..f2c85cabb52 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -493,7 +493,6 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple, bool binar
HeapTuple typtup;
Form_pg_type typclass;
Form_pg_attribute att = TupleDescAttr(desc, i);
- char *outputstr;
if (att->attisdropped || att->attgenerated)
continue;
@@ -537,6 +536,8 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple, bool binar
}
else
{
+ char *outputstr;
+
pq_sendbyte(out, LOGICALREP_COLUMN_TEXT);
outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
pq_sendcountedtext(out, outputstr, strlen(outputstr), false);