Is there a way to abort a long COPY?

Anders Andersson <[email protected]> Thu, 10 Jul 2014 02:45:19 +0200
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <CAKkunMbQSf68B3mkzWJrvQsa-5+9gS=C4KcejHuFRFOFLdZfPQ@mail.gmail.com>
Hi! I'm reading a lot of data from a database using the "COPY
(SELECT...) TO STDOUT" method but occasionally I need to abort the
process mid-way. When doing that, it seems that the COPY process
continues on the server, long after I have disconnected from the
database in my script. Is there a way to tell the server to abort the
COPY?

$sth->finish() does not seem to do anything about it.

I'm using DBD::Pg 2.19.2 in my script and PostgreSQL 9.1 on the server
if that makes a difference.

// Anders