Re: Conversion of columns during CSV Import

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Patrick Schneider <patrick(dot)schneider(at)debeka(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Conversion of columns during CSV Import
Date: 2012-06-29 17:10:26
Message-ID: 4FEDE182.9080002@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29/06/2012 08:54, Patrick Schneider wrote:
> Hello,
>
> is there any possibility to convert special columns during an CSV import
> via COPY?
> For example:
>
> HELLO;WORLD;9999;011001
>
> 9999 should be converted to a character field
> 011001 to the date 10th January 2001
>
> For the moment the only idea we have is, to import the CSV into a TEMP
> table and
> perform the conversion by a select from the temp to the target table.

I don't think there is; AFAIK the only option is the one you've outlined.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2012-06-29 17:27:45 Re: Conversion of columns during CSV Import
Previous Message Tom Lane 2012-06-29 15:10:15 Re: Notiffy problem