Re: Inserting a select statement result into another table

From: Denis Perchine <dyp(at)perchine(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>, Ben Adida <ben(at)openforce(dot)net>, Andrew Selle <aselle(at)upl(dot)cs(dot)wisc(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inserting a select statement result into another table
Date: 2000-10-13 04:02:29
Message-ID: 0010131102290Q.01672@dyp.perchine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

just my $0.02...
If I do
insert into x
select * from y limit 10;

I will get all of rows in x inserted, not just 10...
I already wrote about this... But did not get any useful reply.

> This is an interesting idea. We don't allow ORDER BY in INSERT INTO ...
> SELECT because it doesn't make any sense, but it does make sense if
> LIMIT is used:
>
> ctest=> create table x (Y oid);
> CREATE
> test=> insert into x
> test-> select oid from pg_class order by oid limit 1;
> ERROR: LIMIT is not supported in subselects
>
> Added to TODO:
>
> Allow ORDER BY...LIMIT in INSERT INTO ... SELECT

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp(at)perchine(dot)com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Constantin Teodorescu 2000-10-13 05:12:49 Re: [HACKERS] PgAccess - small bug?
Previous Message Bruce Momjian 2000-10-13 03:02:05 FreeBSD core team history