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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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