Re: Problems importing csv files - Mailing list pgsql-novice

From Robert Schnabel
Subject Re: Problems importing csv files
Date
Msg-id 4A3FE67D.2080401@missouri.edu
Whole thread Raw
In response to Problems importing csv files  (Kindra Martinenko <kindramart@yahoo.com>)
List pgsql-novice
Kindra Martinenko wrote:
<blockquote cite="mid:249550.32069.qm@web30207.mail.mud.yahoo.com"
 type="cite">

  <div
 style="font-family: arial,helvetica,sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  Hello,


  I am having problems importing csv files into postgresql. I am
hoping someone has had a similar problem and could help me troubleshoot.



  I created a table that mimics the csv table I want to read from.
 I set privleges to "All" and have been attempting to execute the
following procedure:




  <font class="Apple-style-span"
 face="'Courier New', courier, monaco, monospace, sans-serif">COPY
BaxterCommercial WITH OIDS FROM 'H:\...\BaxterCommercial.csv'
  <font class="Apple-style-span"
 face="'Courier New', courier, monaco, monospace, sans-serif">USING
DELIMITERS ',';







You need to escape the \ and maybe use the absolute path.
http://www.postgresql.org/docs/8.3/interactive/sql-copy.html

If you're using Windows try this but put the full path name instead of
...  I use this frequently to load large files.
<font class="Apple-style-span"
 face="'Courier New', courier, monaco, monospace, sans-serif">COPY
BaxterCommercial WITH OIDS FROM E'H:\\...\\BaxterCommercial.csv'
<font class="Apple-style-span"
 face="'Courier New', courier, monaco, monospace, sans-serif">WITH CSV;

Bob

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problems importing csv files
Next
From: Kindra Martinenko
Date:
Subject: Re: Problems importing csv files