pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lee Hachadoorian <lee.hachadoorian@gmail.com>
Cc: PostgreSQL (SQL) <pgsql-sql@postgresql.org>
Subject: Re: COPY without quoting
Date: Thu, 15 Mar 2012 12:23:34 -0400
Message-ID: <21644.1331828614@sss.pgh.pa.us> (raw)
In-Reply-To: <4F6215CE.7050207@gmail.com>
References: <4F6215CE.7050207@gmail.com>

Lee Hachadoorian <lee.hachadoorian@gmail.com> writes:
> COPY ... TO ... WITH CSV defaults to quoting string fields with embedded 
> delimiters, quotes, and newlines. In pgAdmin I can execute to file and 
> specify "no quoting" for the output, in which case I get (what I want) a 
> file with no quotes, even though there are embedded commas in the 
> strings.

Uh ... why exactly would you want that?  It seems impossible to parse
such a file.

If what you want is an unparsable file, you could just strip out the
quotes with "sed" after the fact.  But COPY is not in the business of
producing non-machine-readable files, so the fact that it doesn't have
an option for this doesn't bother me.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <21644.1331828614@sss.pgh.pa.us>
Permalink:  ../21644.1331828614@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21644.1331828614@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lee.hachadoorian@gmail.com
  Subject: Re: COPY without quoting
  In-Reply-To: <21644.1331828614@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox