Re: COPY without quoting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>
Cc: "PostgreSQL (SQL)" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: COPY without quoting
Date: 2012-03-15 16:23:34
Message-ID: 21644.1331828614@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Lee Hachadoorian 2012-03-15 16:52:45 Re: COPY without quoting
Previous Message Lee Hachadoorian 2012-03-15 16:16:14 COPY without quoting