Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAEWR-0002qV-LL for pgsql-docs@arkaria.postgresql.org; Mon, 24 Aug 2020 15:36:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAEVu-0005db-Pg for pgsql-docs@arkaria.postgresql.org; Mon, 24 Aug 2020 15:36:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAEVu-0005dU-Jj for pgsql-docs@lists.postgresql.org; Mon, 24 Aug 2020 15:36:02 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAEVs-00005S-0e for pgsql-docs@lists.postgresql.org; Mon, 24 Aug 2020 15:36:02 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kAEVp-0007M3-OS; Mon, 24 Aug 2020 11:35:57 -0400 Date: Mon, 24 Aug 2020 11:35:57 -0400 From: Bruce Momjian To: Pavel Stehule Cc: "David G. Johnston" , Robin Abbi , Dave Cramer , Pg Docs Subject: Re: Procedures Message-ID: <20200824153557.GK26781@momjian.us> References: <20200806001758.GA29874@momjian.us> <20200806221052.GA23547@momjian.us> <20200821225214.GJ13363@momjian.us> <20200822171447.GF26781@momjian.us> <20200824150056.GI26781@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Aug 24, 2020 at 05:24:19PM +0200, Pavel Stehule wrote: > > > po 24. 8. 2020 v 17:01 odesílatel Bruce Momjian 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 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? -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee