Re: Allow COPY's 'text' format to output a header - Mailing list pgsql-hackers

From Garick Hamlin
Subject Re: Allow COPY's 'text' format to output a header
Date
Msg-id 20180514184459.GA1272@isc.upenn.edu
Whole thread Raw
In response to Re: Allow COPY's 'text' format to output a header  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Allow COPY's 'text' format to output a header  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On Mon, May 14, 2018 at 09:37:07AM +0900, Michael Paquier wrote:
> On Sun, May 13, 2018 at 07:01:00PM -0400, David Steele wrote:
> > This patch makes sense to me and looks reasonable.
> 
> One "potential" problem is if a relation has a full set of column which
> allows the input of text-like data: if the header has been added with
> COPY TO, and that the user forgets to add again the header option with
> COPY FROM, then an extra row will be generated but there is the same
> problem with CSV format :)

Yeah, I wonder if that can be addressed.  

I wonder if there was a way to let COPY FROM detect or ignore headers
as appropriate and rather than cause silently result in headers being
added as data.

Maybe a blank line after the header line could prevent this confusion?

Garick


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: SPI/backend equivalent of extended-query Describe(statement)?
Next
From: Robert Haas
Date:
Subject: Re: explain (verbose off, normalized) vs query planid