Re: A question about StartSubTransaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: A question about StartSubTransaction
Date: 2022-09-14 05:52:50
Message-ID: 2535808.1663134770@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Japin Li <japinli(at)hotmail(dot)com> writes:
> IIRC, AtSubStart_Memory, AtSubStart_ResourceOwner and AfterTriggerBeginSubXact don't
> use s->state.

No, they don't.

> Why should we set s->state to TRANS_START and then TRANS_INPROGRESS?

I believe it's so that if an error gets thrown somewhere in that
area, we'll recover properly. I'd be the first to say that this
stuff isn't terribly well-tested, since it's hard to force an
error there.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2022-09-14 06:00:57 Re: A question about StartSubTransaction
Previous Message Japin Li 2022-09-14 05:41:24 A question about StartSubTransaction