Re: Inserting a select statement result into another table

Поиск
Список
Период
Сортировка
Искать
От
Denis Perchine
Тема
Re: Inserting a select statement result into another table
Дата
Msg-id
0010131102290Q.01672@dyp.perchine.com
Ответ на
Список
Дерево обсуждения
Re: Inserting a select statement result into another table Ben Adida <ben@openforce.net>
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 по дате отправления
От: Bruce Momjian
Дата:
Сообщение: FreeBSD core team history
От: Tatsuo Ishii
Дата:
Сообщение: copy and length coercion
FAQ