From 0d731aa12e6d9a59e61cebe9c0a7d71025f000f8 Mon Sep 17 00:00:00 2001 From: Oleksandr Shulgin Date: Tue, 30 Jun 2015 16:34:17 +0200 Subject: [PATCH] Comment on special handling of PGRES_COPY_BOTH --- psycopg/pqpath.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 03d928cf..04789d35 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -1062,6 +1062,10 @@ pq_get_last_result(connectionObject *conn) PQclear(result); } result = res; + + /* After entering copy both mode, libpq will make a phony + * PGresult for us every time we query for it, so we need to + * break out of this endless loop. */ if (PQresultStatus(result) == PGRES_COPY_BOTH) { break; }