Re: Inserting a select statement result into another table - Mailing list pgsql-hackers

From Denis Perchine
Subject Re: Inserting a select statement result into another table
Date
Msg-id 0010131102290Q.01672@dyp.perchine.com
Whole thread Raw
In response to Re: Inserting a select statement result into another table  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: FreeBSD core team history
Next
From: Tatsuo Ishii
Date:
Subject: copy and length coercion