Re: Procedures

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robin Abbi <robin(dot)abbi(at)downley(dot)net>, Dave Cramer <davecramer(at)postgres(dot)rocks>, Pg Docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Procedures
Date: 2020-08-24 15:51:29
Message-ID: CAFj8pRCZOa6739u88_vMV5uqB2kWFST3DCU0Y6wPx1b9DFfbUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

po 24. 8. 2020 v 17:38 odesílatel Bruce Momjian <bruce(at)momjian(dot)us> napsal:

> On Mon, Aug 24, 2020 at 11:35:57AM -0400, Bruce Momjian wrote:
> > On Mon, Aug 24, 2020 at 05:24:19PM +0200, Pavel Stehule wrote:
> > >
> > >
> > > po 24. 8. 2020 v 17:01 odesílatel Bruce Momjian <bruce(at)momjian(dot)us>
> napsal:
> > >
> > > On Sat, Aug 22, 2020 at 01:21:43PM -0700, David G. Johnston wrote:
> > > > On Sat, Aug 22, 2020 at 10:14 AM Bruce Momjian <bruce(at)momjian(dot)us>
> wrote:
> > > >
> > > > On Fri, Aug 21, 2020 at 07:42:35PM -0700, David G. Johnston
> wrote:
> > > >
> > > > > [...] the CALL command. If the CALL command is not part
> of an
> > > explicit
> > > > > transaction a procedure can also manage multiple
> transactions
> > > during its
> > > > > execution.
> > > >
> > > > OK, how is this updated patch?
> > > >
> > > >
> > > > Looks good. I felt "begin and commit" was a bit wordy but it
> works.
> > >
> > > So, I was worried that "manage multiple transactions" could imply
> > > something like savepoints, which can be managed by functions. It
> is
> > > really the top-level begin/commit that is unique for procedures.
> > >
> > > Functions is executed under outer transaction every time - rollback to
> save
> > > point hasn't impact on outer transaction. Inside procedures (in
> special case)
> > > can be transactions ended (by statements COMMIT or ROLLBACK).
> Immediately is
> > > started new transaction.
> >
> > Well, savepoints control what commands are considered _part_ of the
> > outer transaction, so in a way you are managing what is in the outer
> > transaction. This is why begin/commit was clearer for me. Maybe "start
> > and commit" is clearer?
>
> Should the new text be?
>
> a procedure can commit and begin new transactions during its
> execution.
>

sure. Maybe enhancing about sentence like "it is not possible in a
function."

and

"a procedure can commit (or rollback) and begin new transactions during its
execution"

> --
> Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
> EnterpriseDB https://enterprisedb.com
>
> The usefulness of a cup is in its emptiness, Bruce Lee
>
>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Alvaro Herrera 2020-08-24 15:59:22 Re: Document "59.2. Built-in Operator Classes" have a clerical error?
Previous Message Bruce Momjian 2020-08-24 15:38:47 Re: Procedures