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

Problems importing csv files

From: Kindra Martinenko <kindramart(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Problems importing csv files
Date: 2009-06-22 20:05:16
Message-ID: 249550.32069.qm@web30207.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
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 ',';

However, I keep getting the following error:

WARNING:  nonstandard use of escape in a string literal
LINE 1: COPY BaxterCommercial WITH OIDS FROM 'H:\transpor\Traffic Co...
                                             ^
HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
ERROR:  relation "baxtercommercial" does not exist

Obviously I am missing something, but I am not sure what it wants from me in terms of "escape string syntax"?  I tried putting an \r at the end as well as a '\r\n'

Example:  
COPY BaxterCommercial WITH OIDS FROM 'H:\...\BaxterCommercial.csv'
USING DELIMITERS ','
WITH NULL AS '\r\n';

Doing so resulted in the same error.

Thanks in advance for any help provided!

Kindra


      

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2009-06-22 20:10:05
Subject: Re: Problems importing csv files
Previous:From: Kevin DuffyDate: 2009-06-21 16:41:19
Subject: Re: level of recursion

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