Re: How to import CSV file?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
Cc: Chris Hoover <revoohc(at)gmail(dot)com>, Medi Montaseri <montaseri(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to import CSV file?
Date: 2007-08-28 19:34:42
Message-ID: 1966.1188329682@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jeff Frost <jeff(at)frostconsultingllc(dot)com> writes:
> On Tue, 28 Aug 2007, Chris Hoover wrote:
>> Why go through all of this when COPY can handle this for you? All I need to
>> know is the syntax to tell copy that the strings are quoted by a single
>> quote.

> Probably you want to try something like:
> COPY foo FROM '/tmp/foo' WITH CSV QUOTE AS '\'';

Actually I'd recommend WITH CSV QUOTE AS '''' ... the backslash syntax
is nonstandard and will bite you eventually. Doubled quote works in
every version of PG.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message John R Allgood 2007-08-28 19:40:03 Re: How to monitor resources on Linux.
Previous Message Alvaro Herrera 2007-08-28 19:11:44 Re: How to monitor resources on Linux.