Re: BUG #3811: Getting multiple values from a sequence generator

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "NikhilS" <nikkhils(at)gmail(dot)com>
Cc: "Adriaan van Os" <postgres(at)microbizz(dot)nl>, <pgsql-bugs(at)postgresql(dot)org>, "Michael Glaesemann" <grzm(at)seespotcode(dot)net>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG #3811: Getting multiple values from a sequence generator
Date: 2007-12-10 13:14:50
Message-ID: 87y7c2g08l.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

"NikhilS" <nikkhils(at)gmail(dot)com> writes:

> Coincidently, I very briefly discussed (offline) about supporting
> expressions while doing loads using COPY FROM with Heikki a while back. From
> the above mail exchanges, it does appear that adding this kind of
> functionality will be useful while doing bulk imports into tables using
> COPY.
>
> Heikki's initial suggestion was as follows:
>
> COPY <table> FROM <file> USING <query>
>
> Where query could be any SELECT query, executed once for row using the
> values from the input data file. For example:

Another direction to head would be to take away COPY's special logic to insert
into tables and instead have something like:

COPY FROM <file> USING <query>

where <query> is an *INSERT* statement. Or for that matter a DELETE or an
UPDATE. It would prepare the query then execute it once per line read from the
streamed copy data.

It would be much more general but perhaps be harder to optimize the our
current COPY can be optimized.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2007-12-10 13:24:03 Re: [HACKERS] BUG #3799: csvlog skips some logs
Previous Message Simon Riggs 2007-12-10 12:14:10 Re: BUG #3811: Getting multiple values from a sequence generator

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-12-10 13:24:03 Re: [HACKERS] BUG #3799: csvlog skips some logs
Previous Message Andrew Dunstan 2007-12-10 13:13:14 Re: Release Note Changes