Re: bug in COPY - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bug in COPY
Date
Msg-id 18364.1027608626@sss.pgh.pa.us
Whole thread Raw
In response to Re: bug in COPY  (nconway@klamath.dyndns.org (Neil Conway))
List pgsql-hackers
nconway@klamath.dyndns.org (Neil Conway) writes:
>> 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).

> Yeah, I was thinking that too. Now that we have column lists in
> COPY, there is no need to keep this functionality around: if the
> user wants to load data that is missing a column, they can just
> omit the column from the column list and have the column default
> inserted (which is a lot more sensible than inserting NULL).

Right, that was the thinking exactly.

> Unfortunately, I think that removing this properly will require
> refactoring some of the COPY code. I'll take a look at implementing
> this...

I thought it could be hacked in pretty easily, but if you want to
clean up the structure while you're in there, go for it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Marc Lavergne
Date:
Subject: Re: Oracle Decode Function
Next
From: Tom Lane
Date:
Subject: Re: Oracle Decode Function