Re: Autonomous Transaction (WIP)

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Autonomous Transaction (WIP)
Дата
Msg-id 20140407101936.GA4161@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: Autonomous Transaction (WIP)  (Atri Sharma <atri.jiit@gmail.com>)
Список pgsql-hackers
On 2014-04-07 15:46:42 +0530, Atri Sharma wrote:
> On Mon, Apr 7, 2014 at 3:41 PM, Pavel Stehule <pavel.stehule@gmail.com>wrote:
> I am missing something here, but how does making it a subtransaction break
> consistency? Isnt that what should actually be happening so that the
> autonomous transaction's changes are actually visible till the parent
> transaction commits?
> 
> What am I missing here?

START TRANSACTION;
INSERT INTO referenced_to_table ... id = 1;
START AUTONOMOUS SUBTRANSACTION;
INSERT INTO referencing_table id = 1 ...;
COMMIT AUTONOMOUS SUBTRANSACTION;
ROLLBACK;

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Atri Sharma
Дата:
Сообщение: Re: Autonomous Transaction (WIP)
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Autonomous Transaction (WIP)