Skip site navigation (1) Skip section navigation (2)

Re: Problems importing csv files

From: Kindra Martinenko <kindramart(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problems importing csv files
Date: 2009-06-22 23:15:40
Message-ID: 448995.80419.qm@web30207.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: 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(at)missouri(dot)edu>
To: Kindra Martinenko <kindramart(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)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



      

Responses

pgsql-novice by date

Next:From: Robert SchnabelDate: 2009-06-22 23:29:24
Subject: Re: Problems importing csv files
Previous:From: Robert SchnabelDate: 2009-06-22 20:15:57
Subject: Re: Problems importing csv files

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group