Thread: pgAdmin III commit: Fix the query editor behaviour with COPY

pgAdmin III commit: Fix the query editor behaviour with COPY

From
Guillaume Lelarge
Date:
Fix the query editor behaviour with COPY

If you run something like:

copy (select * from pg_stat_activity) to stdout;

in the query editor, it will hang forever. The code in
pgQueryThread::execute() doesn't check for a PGRES_COPY_OUT result, and
calls PQgetResult() repeatedly. PQgetResult() will keep on returning
PGRES_COPY_OUT until the copy output is read with PQgetCopyData(), so it
gets stuck. COPY FROM STDIN has a similar problem.

This patch fixes that. For COPY TO STDOUT, it prints the first
100 rows to the message display. For COPY FROM STDIN, it throws an error.

Branch
------
REL-1_16_0_PATCHES

Details
-------
http://git.postgresql.org/gitweb?p=pgadmin3.git;a=commitdiff;h=62ac3f013fd418814dec7fe9a63dce8c7e957383
Author: Heikki Linnakangas <hlinnakangas@vmware.com>

Modified Files
--------------
CHANGELOG                          |    2 +
pgadmin/db/pgQueryThread.cpp       |   62 ++++++++++++++++++++++++++++++++++--
pgadmin/include/db/pgQueryThread.h |    2 +
3 files changed, 63 insertions(+), 3 deletions(-)


Re: pgAdmin III commit: Fix the query editor behaviour with COPY

From
Guillaume Lelarge
Date:
Hi,

2014-12-05 10:46 GMT+01:00 José Pino <pino@getyourguide.com>:
Hi Guillaume,

Is it not possible to change this limit? As a user, why I can't define this row limit in 200 or 1000?


Most likely because nobody bothered to write a patch for this. Actually, that's the first time I hear someone complaining about this. Note that it wouldn't be complex to do, but I don't really see the point: you're not supposed to use COPY in the query editor. That's the wrong tool for it.


--