copy from csv

From: "Scott Porter" <scott(at)frontierus(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: copy from csv
Date: 2008-10-21 15:23:28
Message-ID: 616F14BF5C4C7F4BA02CFBC604CB30BA0299DCE7@mx1.frontierus.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am copying data from a CSV file using the query noted below. Many
items in my CSV file contain the double quotes in the field (i.e., '20"
COLOR MONITOR'). This field imports as, '""20"" COLOR MONITOR""'. How
do I remove all those extra quotes? Also, should I be using the STDIN
parameter or is my query below sufficient?

COPY item_master

(id, description, unit_measure, mfg, product_line)

FROM 'c:/item_test1.csv'

using delimiters ','

Browse pgsql-novice by date

  From Date Subject
Next Message gcj 2008-10-21 17:11:35 Simple Text Field Encryption
Previous Message Tom Lane 2008-10-20 03:37:09 Re: ERROR: could not find tuple for attrdef NNNNNNNN