Re: New docs chapter on Transaction Management and related changes

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Erik Rijkers <er(at)xs4all(dot)nl>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New docs chapter on Transaction Management and related changes
Date: 2022-10-24 15:01:51
Message-ID: CANbhV-ELb5W0CXfhOP9D-JRBHfr_ajKx1LCYOSJwp9R8rxjF_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 16 Oct 2022 at 02:08, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> On Fri, Oct 14, 2022 at 05:46:55PM -0400, Robert Treat wrote:
> > On Fri, Oct 14, 2022 at 3:51 PM Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > > Attached is the merged patch from all the great comments I received. I
> > > have also rebuilt the docs with the updated patch:
> > >
> > > https://momjian.us/tmp/pgsql/
> > >
> >
> > + <command>RELEASE SAVEPOINT</command> also subcommits and destroys
> > + all savepoints that were established after the named savepoint was
> > + established. This means that any subtransactions of the named savepoint
> > + will also be subcommitted and destroyed.
> >
> > Wonder if we should be more explicit that data changes are preserved,
> > not destroyed... something like:
> > "This means that any changes within subtransactions of the named
> > savepoint will be subcommitted and those subtransactions will be
> > destroyed."
>
> Good point. I reread the section and there was just too much confusion
> over subtransactions, partly because the behavior just doesn't map
> easily to subtransaction. I therefore merged all three paragraphs into
> one and tried to make the text saner; release_savepoint.sgml diff
> attached, URL content updated.

Just got around to reading this, thanks for changes.

The rewording doesn't work for me. The use of the word "destroy" is
very misleading, since the effect is to commit.

So I think we must avoid use of the word destroy completely. Possible
rewording:

<command>RELEASE SAVEPOINT</command> will subcommit the subtransaction
established by the named savepoint, releasing any resources held by
it. If there were any subtransactions created by the named savepoint,
these will also be subcommitted.

The point is that savepoints create subtransactions, but they are not
the only way to create them, so we cannot equate savepoint and
subtransaction completely.

--
Simon Riggs http://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Frédéric Yhuel 2022-10-24 15:26:50 [PATCH] minor optimization for ineq_histogram_selectivity()
Previous Message Peter Geoghegan 2022-10-24 14:56:24 Re: effective_multixact_freeze_max_age issue