Re: COPY commands could use an enhancement.

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alfred Perlstein <bright(at)wintelcom(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY commands could use an enhancement.
Date: 2001-04-30 17:25:32
Message-ID: 200104301725.f3UHPWs20913@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Alfred Perlstein <bright(at)wintelcom(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fernando Nasser 2001-04-30 17:28:10 Re: COPY commands could use an enhancement.
Previous Message Alfred Perlstein 2001-04-30 16:30:04 Re: COPY commands could use an enhancement.