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

From Kindra Martinenko
Subject Re: Problems importing csv files
Date
Msg-id 448995.80419.qm@web30207.mail.mud.yahoo.com
Whole thread Raw
In response to Problems importing csv files  (Kindra Martinenko <kindramart@yahoo.com>)
Responses Re: Problems importing csv files
List pgsql-novice
Thanks Robert  & Tim, this was very helpful, however

I tried:

COPY BaxterCommercial 
FROM E'H:\\transpor\\Traffic Counts\\TMS\\MarApr09\\BaxterCommercial.csv'
WITH CSV;

And it returned with this error:


ERROR:  relation "baxtercommercial" does not exist

Any ideas?

Thanks,

Kindra

From: Robert Schnabel <schnabelr@missouri.edu>
To: Kindra Martinenko <kindramart@yahoo.com>
Cc: pgsql-novice@postgresql.org
Sent: Monday, June 22, 2009 1:15:57 PM
Subject: Re: [NOVICE] Problems importing csv files


Kindra Martinenko wrote:
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:

COPY BaxterCommercial WITH OIDS FROM 'H:\...\BaxterCommercial.csv'
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.
COPY BaxterCommercial WITH OIDS FROM E'H:\\...\\BaxterCommercial.csv'
WITH CSV;

Bob

pgsql-novice by date:

Previous
From: Robert Schnabel
Date:
Subject: Re: Problems importing csv files
Next
From: Robert Schnabel
Date:
Subject: Re: Problems importing csv files