Re: COPY table to file missing quotation marks

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY table to file missing quotation marks
Date: 2013-02-03 03:03:34
Message-ID: kekk26$mjn$2@gonzo.reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2013-01-31, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
> I'd like to understand what I'm missing when I COPY a table to a .csv file
> but the text is not quoted.
>
> Here's an example of a command:
>
> copy chemistry to '/home/postgres/emapchem.csv' with (format CSV, header True, quote '"', delimiter '|');
>
> and here're part of the header and following row of the output:
>
> siteid|sampdate|analdate|ph|cond|turb|tss|doc|dic|p|se|ca|mg|na|k|nh4|so4|no3
> 1993SBOIA049|2004-06-28|2004-06-28|7.67|117|4.21|6.1|1.13|11.96|40|0.2|503.5|206.2
>
> I'm sure it's something simple in the syntax I keep getting wrong, but I
> don't see it.

Quotes are optional in csv except for strings containg linebreaks, quotes,
or delimiters where they are required.

--
⚂⚃ 100% natural

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2013-02-03 04:08:36 Re: finding if a period is multiples of a given interval
Previous Message Jasen Betts 2013-02-03 02:58:12 Re: Can LC_TIME affect timestamp input?