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 1lJPM6-0003ZJ-4J for pgsql-general@arkaria.postgresql.org; Mon, 08 Mar 2021 23:32:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJPM5-0001JK-22 for pgsql-general@arkaria.postgresql.org; Mon, 08 Mar 2021 23:32:05 +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 1lJPM4-0001JC-R1 for pgsql-general@lists.postgresql.org; Mon, 08 Mar 2021 23:32:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJPM2-0004B9-RQ for pgsql-general@lists.postgresql.org; Mon, 08 Mar 2021 23:32:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 128NVudA1932631; Mon, 8 Mar 2021 18:31:56 -0500 From: Tom Lane To: raf cc: Adrian Klaver , "Bysani, Ram" , "pgsql-general@lists.postgresql.org" Subject: Re: Need help with clarification on stored procedure support in PostGreSQL database In-reply-to: <20210308222228.gljiuauwdd4p3kxs@raf.org> References: <29836c19-5321-7093-bc88-a82c6a497a36@aklaver.com> <20210308222228.gljiuauwdd4p3kxs@raf.org> Comments: In-reply-to raf message dated "Tue, 09 Mar 2021 09:22:28 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1932629.1615246316.1@sss.pgh.pa.us> Date: Mon, 08 Mar 2021 18:31:56 -0500 Message-ID: <1932630.1615246316@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk raf writes: > Is there any important different between a stored procedure and > a stored function that returns void? I've been using functions > for everything but calling them procedures in my head (even though > most of them do return a value or result set). A procedure can commit or rollback a transaction (and then start a new one). regards, tom lane