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 1kAEtd-0003mg-On for pgsql-docs@arkaria.postgresql.org; Mon, 24 Aug 2020 16:00:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAEtc-0004Cb-MW for pgsql-docs@arkaria.postgresql.org; Mon, 24 Aug 2020 16:00:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAEtc-0004CU-H8 for pgsql-docs@lists.postgresql.org; Mon, 24 Aug 2020 16:00:32 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAEtW-0001kH-Ap for pgsql-docs@lists.postgresql.org; Mon, 24 Aug 2020 16:00:31 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kAEtT-0001hj-2G; Mon, 24 Aug 2020 12:00:23 -0400 Date: Mon, 24 Aug 2020 12:00:23 -0400 From: Bruce Momjian To: Pavel Stehule Cc: "David G. Johnston" , Robin Abbi , Dave Cramer , Pg Docs Subject: Re: Procedures Message-ID: <20200824160023.GM26781@momjian.us> References: <20200806221052.GA23547@momjian.us> <20200821225214.GJ13363@momjian.us> <20200822171447.GF26781@momjian.us> <20200824150056.GI26781@momjian.us> <20200824153557.GK26781@momjian.us> <20200824153847.GL26781@momjian.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="phCU5ROyZO6kBE05" 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 --phCU5ROyZO6kBE05 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Aug 24, 2020 at 05:51:29PM +0200, Pavel Stehule wrote: > 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" OK, updated patch. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee --phCU5ROyZO6kBE05 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="proc.diff" diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index 6de464c654..5dda2a80af 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -84,8 +84,11 @@ A procedure is a database object similar to a function. The difference is that a procedure does not return a value, so there is no return type declaration. While a function is called as part of a query or DML - command, a procedure is called explicitly using - the statement. + command, a procedure is called in isolation using + the command. If the CALL command is not + part of an explicit transaction, a procedure can commit, rollback, + and begin new transactions during its execution, which is not possible + in functions. --phCU5ROyZO6kBE05--