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,
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",