memcpy(result, PQgetvalue(res, 0, 0), len);
result[len] = '\0';
+ PQclear(res);
+
pg_log(PG_DEBUG, "fetched file \"%s\", length %d\n", filename, len);
if (filesize)
if (PQresultStatus(res) != PGRES_COMMAND_OK)
pg_fatal("could not create temporary table: %s",
PQresultErrorMessage(res));
+ PQclear(res);
sql = "COPY fetchchunks FROM STDIN";
res = PQexec(conn, sql);
if (PQresultStatus(res) != PGRES_COPY_IN)
pg_fatal("could not send file list: %s",
PQresultErrorMessage(res));
+ PQclear(res);
for (i = 0; i < map->narray; i++)
{
if (PQresultStatus(res) != PGRES_COMMAND_OK)
pg_fatal("unexpected result while sending file list: %s",
PQresultErrorMessage(res));
+ PQclear(res);
}
/*