Search Postgresql Archives

Re: Why doesn't COPY support the HEADER options for tab-separated output?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 15, 2013 at 09:25:07AM +0100, Richard Huxton wrote:
> On 12/08/13 23:18, Bruce Momjian wrote:
> >On Mon, Aug 12, 2013 at 03:17:00PM -0700, Jeff Janes wrote:
> >>On Mon, Aug 12, 2013 at 2:21 PM, Bruce Momjian <bruce@xxxxxxxxxx> wrote:
> >>>On Mon, Aug 12, 2013 at 02:15:25PM -0700, Joe Van Dyk wrote:
> >>>>Mostly just curious, as this is preventing me from using tab-separated output.
> >>>>I'd like there to be a header in my files. I have to use CSVs instead.
> 
> Late to the discussion, but it does work to set format=csv and
> delimiter = E'\t' to get tab-separated. Be nice not to have to
> though.

I assume that is going to add quotes to a field that contains quotes:

	CREATE TABLE test(x TEXT);
	INSERT INTO test VALUES ('"a"');

	COPY test TO STDOUT WITH (FORMAT CSV, DELIMITER E'\t');
	"""a"""

I have added this to the TODO list:

	Allow COPY "text" format to output a header

-- 
  Bruce Momjian  <bruce@xxxxxxxxxx>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux