Re: \COPY ... CSV with hex escapes

From: Peter Hunsberger <peter(dot)hunsberger(at)gmail(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: \COPY ... CSV with hex escapes
Date: 2010-07-08 02:37:30
Message-ID: AANLkTin_G-TgWZe7aSgfcGk8PII0Mc-vXpsPhyinZbrS@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 7, 2010 at 9:21 PM, Craig Ringer
<craig(at)postnewspapers(dot)com(dot)au> wrote:
> Hi folks
>
> I have an odd csv input format to deal with. I'm about to put some
> Python together to reprocess it, but I thought I'd check in and see if
> I'm missing something obvious in \copy's capabilities.
>
> The input is fairly conventional comma-delimeted text with quoted
> fields, as output by Sybase SQL Anywhere 5.5's isql 'OUTPUT TO' filter.
> Yes, that's ancient. It is handled quite happily by \copy in csv mode,
> except that when csv mode is active, \xnn escapes do not seem to be
> processed. So I can have *either* \xnn escape processing *or* csv-style
> input processing.
>
> Anyone know of a way to get escape processing in csv mode?
>
Don't know if you can do it directly, but this seem like one of those
cases where a ETL tool like that from Pentaho (Kettle / Spoon) might
be in order? One step to handle the escape chars and one to load the
actual CSV...

--
Peter Hunsberger

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Harshad Pethe 2010-07-08 04:25:19 Harshad Pethe wants to stay in touch on LinkedIn
Previous Message Craig Ringer 2010-07-08 02:21:19 \COPY ... CSV with hex escapes