Describe the issue
When use PGCopyInputStream to get data, the last row is repeated.
Driver Version?
postgresql-42.2.18
Java Version?
jdk8
OS Version?
windows 10
PostgreSQL Version?
PostgreSQL 8.3.23 (Greenplum Database 5.21.5 build 9999) (HashData Warehouse 2.5.5 build dev)
To Reproduce
this my code:
String copyUCmd="COPY (SELECT casing_tally_id FROM btest limit 1) TO STDOUT WITH CSV DELIMITER AS '|' QUOTE AS '\"'";
try(PGCopyInputStream pgUOut = new PGCopyInputStream( (PGConnection) con, copyUCmd )){
byte[] readFromCopy = pgUOut.readFromCopy();
while(readFromCopy!=null) {
System.out.print(new String(readFromCopy));
readFromCopy = pgUOut.readFromCopy();
}
System.out.println(pgUOut.getHandledRowCount());
}
the console print:
ZJDRM02BESCUCZ
ZJDRM02BESCUCZ
1
Expected behaviour
I think the right print:
Describe the issue
When use PGCopyInputStream to get data, the last row is repeated.
Driver Version?
postgresql-42.2.18
Java Version?
jdk8
OS Version?
windows 10
PostgreSQL Version?
PostgreSQL 8.3.23 (Greenplum Database 5.21.5 build 9999) (HashData Warehouse 2.5.5 build dev)
To Reproduce
this my code:
the console print:
Expected behaviour
I think the right print: