Need help doing a CSV import

From: tony(at)exquisiteimages(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: Need help doing a CSV import
Date: 2010-07-14 11:04:31
Message-ID: 6bb524da685d3e1679573a3c326fc22f.squirrel@www.exquisiteimages.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am in the process of moving a FoxPro based system to PostgreSQL.

We have several tables that have memo fields which contain carriage
returns and line feeds that I need to preserve. I thought if I converted
these into the appropriate \r and \n codes that they would be imported as
carriage returns and line feeds, but instead they are stored in the
database as \r and \n.

The command I am using is:

copy main.company
from E'f:\company.csv"
DELIMITER "|"
CSV HEADER QUOTE '"' ESCAPE E'\\';

The command imports all of the data, but I want the escaped codes to be
expanded to their actual values.

Can anyone assist me with this?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Migowski 2010-07-14 11:40:42 Website FTP Server structure wrong
Previous Message Ankit Kamal 2010-07-14 08:56:53 error "CDT FATAL: invalid frontend message type 69"