Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Well, if the COPY fails on the last value of the first row, and that
> value has a trailing \r, we can be pretty sure.
In the examples given, the error didn't show up till later rows, in
fields where there was no \r anywhere.
> I don't see how your
> solution make it fool-proof, except by requiring every COPY file, old
> and new, and created, to have CR as \r.
There *is no* foolproof solution with the current data representation
(and your idea of throwing untrustworthy error messages is certainly not
foolproof). What we need to do is migrate to a new data representation.
Fortunately, it's nearly there already, since \ r and \ n sequences are
already supported by COPY IN.
regards, tom lane