Re: bug in COPY - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bug in COPY
Date
Msg-id 13554.1027542236@sss.pgh.pa.us
Whole thread Raw
In response to bug in COPY  (nconway@klamath.dyndns.org (Neil Conway))
Responses Re: bug in COPY  (nconway@klamath.dyndns.org (Neil Conway))
Re: bug in COPY  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: bug in COPY  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
nconway@klamath.dyndns.org (Neil Conway) writes:
> This behavior doesn't look right:

It's not, but I believe the correct point of view is that the input
data is defective and should be rejected.  See past discussions
leading up to the TODO item that mentions rejecting COPY input rows
with the wrong number of fields (rather than silently filling with
NULLs as we do now).

A subsidiary point here is that pg_atoi() explicitly takes a zero-length
string as valid input of value 0.  I think this is quite bogus myself,
but I don't know why that behavior was put in or whether we'd be breaking
anything if we tightened it up.
        regards, tom lane


pgsql-hackers by date:

Previous
From: nconway@klamath.dyndns.org (Neil Conway)
Date:
Subject: bug in COPY
Next
From: Marc Lavergne
Date:
Subject: Re: CREATE SYNONYM suggestions