| From: | Andres Freund <andres(at)2ndquadrant(dot)com> |
|---|---|
| To: | Atri Sharma <atri(dot)jiit(at)gmail(dot)com> |
| Cc: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Autonomous Transaction (WIP) |
| Date: | 2014-04-07 10:19:36 |
| Message-ID: | 20140407101936.GA4161@awork2.anarazel.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(dot)stehule(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Pavel Stehule | 2014-04-07 10:20:47 | Re: Autonomous Transaction (WIP) |
| Previous Message | Atri Sharma | 2014-04-07 10:16:42 | Re: Autonomous Transaction (WIP) |