Re: How to import CSV file?

From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: Chris Hoover <revoohc(at)gmail(dot)com>
Cc: 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 18:11:16
Message-ID: Pine.LNX.4.64.0708281109470.31586@discord.home.frostconsultingllc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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.

Check out the docs here:

http://www.postgresql.org/docs/8.1/interactive/sql-copy.html

Probably you want to try something like:

COPY foo FROM '/tmp/foo' WITH CSV QUOTE AS '\'';

--
Jeff Frost, Owner <jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message John R Allgood 2007-08-28 19:00:40 Re: How to monitor resources on Linux.
Previous Message Tom Lane 2007-08-28 18:06:56 Re: How to monitor resources on Linux.