Re: Transactions and ID's generated by triggers

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Transactions and ID's generated by triggers
Дата
Msg-id 01F0EC32-7105-4B18-A06D-B6DE904CB4EC@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на Re: Transactions and ID's generated by triggers  ("David Johnston" <polobo@yahoo.com>)
Ответы Re: Transactions and ID's generated by triggers
Список pgsql-general
On 28 Feb 2011, at 24:37, David Johnston wrote:

> Using pl/pgsql you can:

You don't need pl/pgsql for that. You can return the resultset of the first insert into a client-side variable (while
stillmaking use of the RETURNING-clause of course). 

Of course, the benefit of using pl/pgsql for this is that you could make the desired behaviour independent of
client-implementations(which are all too likely to differ if there are multiple types of clients). However, for that to
workreliably you will need to do some extra work to make sure it's the only possible code-path for inserting those
records.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4d6bf0da235882099214672!



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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Lock ACCESS EXCLUSIVE and Select question !
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Thoroughly confused about time zones