Subject: | COPY FROM broken in 3.5.0 |
Date: | Thu, 08 Jan 2015 03:41:09 +0100 |
To: | bug-DBD-Pg [...] rt.cpan.org |
From: | Ulrich Klauer <ulrich [...] chirlu.de> |
With 3.5.0, this COPY FROM no longer works:
$sql->begin;
$sql->do("COPY table FROM stdin");
my $dbh = $sql->dbh;
while (<LOAD>) { $dbh->pg_putcopydata($_); }
$dbh->pg_putcopyend();
(Simplified to just the database commands; see
https://github.com/metabrainz/musicbrainz-server/blob/master/admin/MBImport.pl#L274 for the full story, if
necessary.)
The error message is: "DBD::Pg::db pg_putcopydata failed: no COPY in
progress"; the Postgres server also logs this error: "COPY from stdin
failed: COPY terminated by new PQexec"
After downgrading to 3.4.2, it works again. I suspect it is related to
the ping changes in 3.5.0 (RT #100648); possibly pg_putcopydata tries
to ping the server, inadvertently terminating copy mode.
Ulrich