Re: COPY enhancements

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: Emmanuel Cecchet <manu(at)asterdata(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY enhancements
Date: 2009-09-12 08:43:46
Message-ID: alpine.GSO.2.01.0909120430040.9961@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 11 Sep 2009, Emmanuel Cecchet wrote:

> I guess the problem with extra or missing columns is to make sure that
> you know exactly which data belongs to which column so that you don't
> put data in the wrong columns which is likely to happen if this is fully
> automated.

Allowing the extra column case is easy: everwhere in copy.c you find the
error message "extra data after last expected column", just ignore the
overflow fields rather than rejecting the line just based on that. And
the default information I mentioned you might want to substitute for
missing columns is already being collected by the code block with the
comment "Get default info if needed".

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Grzegorz Jaskiewicz 2009-09-12 12:06:17 Re: clang's static checker report.
Previous Message Greg Smith 2009-09-12 08:22:01 Re: COPY enhancements