Re: INSERT ... RETURNING in v8.2

Поиск
Список
Период
Сортировка
От PFC
Тема Re: INSERT ... RETURNING in v8.2
Дата
Msg-id op.tt0uw6ugcigqcu@apollo13
обсуждение исходный текст
Ответ на Re: INSERT ... RETURNING in v8.2  (Tom Allison <tom@tacocat.net>)
Список pgsql-general
> 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');

    Yes.

    A smart ORM library should, when you create a new database object from
form values, use INSERT RETURNING to grab all the default values (SERIALs,
DEFAULTs, trigger-generated stuff etc). This is much more elegant than
digging to find the sequence name to currval() it !

    I think this feature is priceless (but it would be even better if I could
do INSERT INTO archive (DELETE FROM active WHERE blah RETURNING *)

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: PHP sucks!! - was: persistent db connections in PHP
Следующее
От: PFC
Дата:
Сообщение: Re: What O/S or hardware feature would be useful for databases?