$dbh->do(qq{COPY "$schema"."$table" TO STDOUT}); my @data; my $record_count = 0; 1 while $dbh->pg_getcopydata($data[$record_count++]) >= 0;