aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/libpqwalreceiver/libpqwalreceiver.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 4dd8eef1f92..9d7bb25d397 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -803,10 +803,6 @@ libpqrcv_processTuples(PGresult *pgres, WalRcvExecResult *walres,
MemoryContext rowcontext;
MemoryContext oldcontext;
- /* No point in doing anything here if there were no tuples returned. */
- if (PQntuples(pgres) == 0)
- return;
-
/* Make sure we got expected number of fields. */
if (nfields != nRetTypes)
ereport(ERROR,
@@ -824,6 +820,10 @@ libpqrcv_processTuples(PGresult *pgres, WalRcvExecResult *walres,
PQfname(pgres, coln), retTypes[coln], -1, 0);
attinmeta = TupleDescGetAttInMetadata(walres->tupledesc);
+ /* No point in doing more here if there were no tuples returned. */
+ if (PQntuples(pgres) == 0)
+ return;
+
/* Create temporary context for local allocations. */
rowcontext = AllocSetContextCreate(CurrentMemoryContext,
"libpqrcv query result context",