Reported-by: Svante Richter
Discussion: https://postgr.es/m/
fcd57e4-8f23-4c3e-a5db-
2571d09208e2@beta.fastmail.com
Backpatch-through: 11
destination, because all data must pass through the client/server
connection. For large amounts of data the
SQL
command might be preferable.
+ Also, because of this pass-through method, \copy
+ ... from in
CSV mode will erroneously
+ treat a \. data value alone on a line as an
+ end-of-input marker.
* This code erroneously assumes '\.' on a line alone
* inside a quoted CSV string terminates the \copy.
+ *
*/
if ((linelen == 3 && memcmp(fgresult, "\\.\n", 3) == 0) ||
(linelen == 4 && memcmp(fgresult, "\\.\r\n", 4) == 0))