Re: COPY with column headings

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2004-08-16 15:59:17 Re: Postgresql.conf Documentation change
Previous Message Jeroen T. Vermeulen 2004-08-16 15:45:22 Re: COPY with column headings