Re: COPY with column headings

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY with column headings
Date: 2004-08-16 19:29:44
Message-ID: 54798A299E68514AB7C4DEBA25F03BE11913DC@postal.corporate.connx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Might be worthwhile to look at SQL*Server BCP format files:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsq
l/ad_impt_bcp_9yat.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref
/ts_ba-bz_4fec.asp

A TCL/TK front end would be especially nice. Of course, being a lazy
slug, I am not volunteering to write any of this. Just a thought in
case someone else is interested in doing it.

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
> Sent: Monday, August 16, 2004 12:04 PM
> To: Andrew Dunstan
> Cc: Bruce Momjian; PostgreSQL-development
> Subject: Re: [HACKERS] COPY with column headings
>
>
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > 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.
>
> Well, if we wanted to *require* a heading row in CSV mode, it
> would be relatively foolproof. What I don't like is the
> proposal for an independent option; you've got a 50-50 chance
> of getting it wrong on import, and that's too high odds for me.
>
> Next question: are you imagining that the header row will
> actually have any semantic significance on input? Will we
> check the column names? Will we be willing to rearrange the
> columns if the header row claims the column order is
> different than the COPY command says?
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
http://archives.postgresql.org

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-08-16 19:38:38 Re: COPY with column headings
Previous Message Andrew Dunstan 2004-08-16 19:27:19 Re: COPY with column headings