Re: INSERT ... RETURNING in v8.2

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: INSERT ... RETURNING in v8.2
Дата
Msg-id 20070617233131.GB3823@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: INSERT ... RETURNING in v8.2  (Tom Allison <tom@tacocat.net>)
Ответы Re: INSERT ... RETURNING in v8.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Allison escribió:

> Holy Crud!
> you mean to tell me I can replace:
>
> insert into table(string) values(('one'),('two'),('three'));
> select idx from table where string in ('one','two','three');
>
> with
>
> insert into table(string) values(('one'),('two'),('three')) returning
> idx;
>
> ?????
>
> I realize that this is an extension to standard SQL but it sure would
> save me a lot.

You are wrong -- you can do it, but it is not an extension.  It is in
the standard.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

В списке pgsql-general по дате отправления:

Предыдущее
От: Ragnar
Дата:
Сообщение: Re: initdb
Следующее
От: Tom Lane
Дата:
Сообщение: Re: INSERT ... RETURNING in v8.2