Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 770139F9CBD for ; Tue, 28 Aug 2007 16:35:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 29263-02 for ; Tue, 28 Aug 2007 16:34:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1DA489FA267 for ; Tue, 28 Aug 2007 16:34:58 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l7SJYgDA001967; Tue, 28 Aug 2007 15:34:42 -0400 (EDT) To: Jeff Frost cc: Chris Hoover , Medi Montaseri , "pgsql-admin@postgresql.org Admin" Subject: Re: How to import CSV file? In-reply-to: References: <1d219a6f0708280838q1312632fg7cbd971cec7cf5ee@mail.gmail.com> <8078a1730708281003n30db4b2eu40f4865672ebab76@mail.gmail.com> <1d219a6f0708281102g7d42c0e9od3b02787fba173fe@mail.gmail.com> Comments: In-reply-to Jeff Frost message dated "Tue, 28 Aug 2007 11:11:16 -0700" Date: Tue, 28 Aug 2007 15:34:42 -0400 Message-ID: <1966.1188329682@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/358 X-Sequence-Number: 26689 Jeff Frost 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