I wrote:
> You ought to be getting something much like the result of
> play=> select '':int4;
> ERROR: parser: parse error at or near ":"
Sheesh, need to learn to count my colons. Of course, what I should've
written was:
play=> select ''::int4;
?column?
-------- 0
(1 row)
which strikes me as being a bug in the INT4 text-to-value conversion
routine: it ought to be griping about bad input. (float4 and float8
also seem overly permissive.)
The other thing COPY is evidently doing is substituting NULLs for
the remaining fields if it hits RETURN before getting the right number
of column separators. I still say that's a bad idea, and that raising
a syntax error would be safer behavior. COPY is not particularly
intended to be user-friendly, it's intended to be a simple and reliable
dump/reload syntax (no?). Allowing omissions in order to ease typing
just makes the behavior less predictable.
regards, tom lane