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

Re: COPY Transform support

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: PFC <lists(at)peufeu(dot)com>
Cc: NikhilS <nikkhils(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY Transform support
Date: 2008-04-03 15:06:14
Message-ID: 200804031706.17334.dfontaine@hi-media.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Le jeudi 03 avril 2008, PFC a écrit :
> CREATE FLATFILE READER mydump (
>         id      INTEGER,
>         date    TEXT,
>         ...
> ) FROM file 'dump.txt'
> (followed by delimiter specification syntax identical to COPY, etc)
> ;
[...]
>         INSERT INTO mytable (id, date, ...) SELECT id, NULLIF( date,
> '0000-00-00'   ), ... FROM mydump WHERE (FKs check and drop the borken
> records);

What do we gain against current way of doing it, which is:
  COPY loadtable FROM 'dump.txt' WITH ...
  INSERT INTO destination_table(...) SELECT ... FROM loadtable; 

-- 
dim

In response to

Responses

pgsql-hackers by date

Next:From: PFCDate: 2008-04-03 15:15:35
Subject: Re: COPY Transform support
Previous:From: Tom LaneDate: 2008-04-03 15:00:26
Subject: Re: COPY Transform support

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