pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Frost <jeff@frostconsultingllc.com>
Cc: Chris Hoover <revoohc@gmail.com>
Cc: Medi Montaseri <montaseri@gmail.com>
Cc: pgsql-admin@postgresql.org Admin <pgsql-admin@postgresql.org>
Subject: Re: How to import CSV file?
Date: Tue, 28 Aug 2007 15:34:42 -0400
Message-ID: <1966.1188329682@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.64.0708281109470.31586@discord.home.frostconsultingllc.com>
References: <1d219a6f0708280838q1312632fg7cbd971cec7cf5ee@mail.gmail.com>
	<8078a1730708281003n30db4b2eu40f4865672ebab76@mail.gmail.com>
	<1d219a6f0708281102g7d42c0e9od3b02787fba173fe@mail.gmail.com>
	<Pine.LNX.4.64.0708281109470.31586@discord.home.frostconsultingllc.com>

Jeff Frost <jeff@frostconsultingllc.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



view thread (5+ messages)

Message-ID: <1966.1188329682@sss.pgh.pa.us>
Permalink:  ../1966.1188329682@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1966.1188329682@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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeff@frostconsultingllc.com, revoohc@gmail.com, montaseri@gmail.com
  Subject: Re: How to import CSV file?
  In-Reply-To: <1966.1188329682@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