Re: COPY commands could use an enhancement. - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: COPY commands could use an enhancement.
Date
Msg-id 200104301725.f3UHPWs20913@candle.pha.pa.us
Whole thread Raw
In response to Re: COPY commands could use an enhancement.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Alfred Perlstein <bright@wintelcom.net> writes:
> > It would be very helpful if the COPY command could be expanded
> > in order to provide positional parameters.
> 
> I think it's a bad idea to try to expand COPY into a full-tilt data
> import/conversion utility, which is the direction that this sort of
> suggestion is headed in.  COPY is designed as a simple, fast, reliable,
> low-overhead data transfer mechanism for backup and restore.  The more
> warts we add to it, the less well it will serve that purpose.

What is really cool is Informix's UNLOAD/LOAD commands.  It combines
COPY with SELECT/INSERT:
UNLOAD TO '/tmp/x'SELECT * FROM tab

and LOAD is similar:
LOAD FROM '/tmp/x'INSERT INTO TAB

This leverages SELECT and INSERT's column and WHERE capabilities to do
almost anything you want with flat files.  I think it is superior to our
COPY.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: COPY commands could use an enhancement.
Next
From: Fernando Nasser
Date:
Subject: Re: COPY commands could use an enhancement.