Re: COPY with column headings

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY with column headings
Date: 2004-08-19 02:36:35
Message-ID: 200408190236.i7J2aZY11119@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to TODO:

> o Allow COPY to optionally include column headings as the first

I know Tom didn't like it but there were others who did.

---------------------------------------------------------------------------

Andrew Dunstan wrote:
>
>
> Tom Lane wrote:
>
> >Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> >
> >
> >>>I certainly think it's worth considering, although I see Tom has
> >>>objected :-) . Say we have an option called FIRSTLINELABELS, then on
> >>>copy out it would write the headings on the first line, and on copy in
> >>>it could just ignore the first line (so it could work symmetrically).
> >>>
> >>>
> >
> >
> >
> >>Yes, that is what I was thinking. Is this a TODO? Sure it can be
> >>misused but most copy options can be similarly misused.
> >>
> >>
> >
> >Most copy options will result in obvious failures if misused. I dislike
> >this one because of the high risk of silent corruption of your data
> >(loss of a row or insertion of a row that shouldn't be there).
> >Considering no one has even made a positive case why we should add it
> >(for instance, a use-case where it's necessary), I don't think it
> >belongs in the to-do list.
> >
> >
> >
> >
>
> The use case is that it fits in with the way spreadsheets usually do
> data tables, and many will only allow you to export a whole worksheet
> (including the heading row) to CSV, not a part of one. Conversely,
> working with imported data tables will be harder if they lack headings.
>
> cheers
>
> andrew
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2004-08-19 02:43:46 Re: Open items
Previous Message Andrew Dunstan 2004-08-19 02:24:13 Re: PGPASSWORD and client tools