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 1k9FtU-000193-9q for pgsql-docs@arkaria.postgresql.org; Fri, 21 Aug 2020 22:52:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k9FtT-00083I-9l for pgsql-docs@arkaria.postgresql.org; Fri, 21 Aug 2020 22:52:19 +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 1k9FtT-00083B-3v for pgsql-docs@lists.postgresql.org; Fri, 21 Aug 2020 22:52:19 +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 1k9FtQ-00021Y-S3 for pgsql-docs@lists.postgresql.org; Fri, 21 Aug 2020 22:52:18 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1k9FtO-0005vQ-F0; Fri, 21 Aug 2020 18:52:14 -0400 Date: Fri, 21 Aug 2020 18:52:14 -0400 From: Bruce Momjian To: Robin Abbi Cc: Dave Cramer , pgsql-docs@lists.postgresql.org Subject: Re: Procedures Message-ID: <20200821225214.GJ13363@momjian.us> References: <159653722937.654.5519018237996991238@wrigleys.postgresql.org> <20200806001758.GA29874@momjian.us> <20200806221052.GA23547@momjian.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="V88s5gaDVPzZ0KCq" Content-Disposition: inline In-Reply-To: <20200806221052.GA23547@momjian.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --V88s5gaDVPzZ0KCq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 6, 2020 at 06:10:52PM -0400, Bruce Momjian wrote: > On Thu, Aug 6, 2020 at 02:30:55PM +0100, Robin Abbi wrote: > > PostgreSQL went as far as release 10 without procedures. > > Some third party resources written before 11 loosely conflate procedures with > > functions. > > Some third party resources written before 11 accurately state PostgreSQL has > > functions but not procedures. > > Referring to the PostgreSQL docs for 11 on, procedures have been added. > > > > For someone like me, coming to the subject without much of a hinterland other > > than googling around, it seemed clear that there was a motivating case that > > caused Procedures to be added to PostgreSQL, but I was not sufficiently > > familiar with the domain to be able to readily intuit what it might have been. > > > > For example, Procedures say they have no return value, yet Functions can return > > void. Not the same I agree, but I wouldn't be aware in which circumstances it > > mattered. > > > > For me, perhaps the most useful thing would have been a small example > > highlighting the essential thing(s) that procedures can do that functions could > > not. > > Agreed, this doc area needs help. I developed the attached patach for this. Is this sufficient? -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee --V88s5gaDVPzZ0KCq 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..0b52feffe5 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -83,7 +83,8 @@ 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 + declaration. Procedures can also begin and commit transactions. + While a function is called as part of a query or DML command, a procedure is called explicitly using the statement. --V88s5gaDVPzZ0KCq--