Re: New docs chapter on Transaction Management and related changes - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: New docs chapter on Transaction Management and related changes
Date
Msg-id 20221110111757.nsfkjm5d64skmpiu@alvherre.pgsql
Whole thread Raw
In response to Re: New docs chapter on Transaction Management and related changes  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: New docs chapter on Transaction Management and related changes
List pgsql-hackers
On 2022-Nov-10, Laurenz Albe wrote:

> On Wed, 2022-11-09 at 09:16 -0500, Robert Treat wrote:

> > > > -      If <literal>AND CHAIN</literal> is specified, a new transaction is
> > > > +      If <literal>AND CHAIN</literal> is specified, a new unaborted transaction is
> > > >        immediately started with the same transaction characteristics (see <xref
> > > >        linkend="sql-set-transaction"/>) as the just finished one.  Otherwise,
> > > >        no new transaction is started.
> > > 
> > > I don't think that is an improvement.  "Unaborted" is an un-word.  A new transaction
> > > is always "unaborted", isn't it?
> > 
> > I thought about this as well when reviewing it, but I do think
> > something is needed for the case where you have a transaction which
> > has suffered an error and then you issue "rollback and chain"; if you
> > just say "a new transaction is immediately started with the same
> > transaction characteristics" it might imply to some the new
> > transaction has some kind of carry over of the previous broken
> > transaction... the use of the word unaborted makes it clear that the
> > new transaction is 100% functional.
> 
> A new transaction is never aborted in my understanding.  Being aborted
> is not a characteristic of a transaction, but a state.

I agree, but maybe it's good to make the point explicit, because it
doesn't seem obvious.  Perhaps something like

"If X is specified, a new transaction (never in aborted state) is
immediately started with the same transaction characteristics (see X) as
the just finished one.  Otherwise ..."

Getting the wording of that parenthical comment right is tricky, though.
What I propose above is not great, but I don't know how to make it
better.  Other ideas that seem slightly worse but may inspire someone:

  ... a new transaction (which is never in aborted state) is ...
  ... a new transaction (not in aborted state) is ...
  ... a new transaction (never aborted, even if the previous is) is ...
  ... a new (not-aborted) transaction is ...
  ... a new (never aborted) transaction is ...
  ... a new (never aborted, even if the previous is) transaction is ...
  ... a new (never aborted, regardless of the status of the previous one) transaction is ...


Maybe there's a way to reword the entire phrase that leads to a better
formulation of the idea.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Nikolay Shaplov
Date:
Subject: Re: TAP output format in pg_regress
Next
From: Simon Riggs
Date:
Subject: Re: New docs chapter on Transaction Management and related changes