Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJf4C-0066jQ-3I for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2024 20:04:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sJf49-002AJH-JO for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2024 20:04:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJf49-002AIr-7w for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2024 20:04:30 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJf47-001xzm-Ig for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2024 20:04:28 +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 45IK4PJF4184543; Tue, 18 Jun 2024 16:04:25 -0400 From: Tom Lane To: "David G. Johnston" cc: Ron Johnson , "pgsql-generallists.postgresql.org" Subject: Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Tue, 18 Jun 2024 11:37:36 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4184541.1718741065.1@sss.pgh.pa.us> Date: Tue, 18 Jun 2024 16:04:25 -0400 Message-ID: <4184542.1718741065@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Tuesday, June 18, 2024, Ron Johnson wrote: >> What's the purpose? Legacy of not having procedures? > So people can have a style guide that says always specify a returns clause > on function definitions. To my mind, the reason we allow RETURNS together with OUT parameter(s) is so there's a place to write SETOF if you want that. Yes, the RETURNS TABLE syntax is somewhat redundant with RETURNS SETOF. Blame the SQL standard for that. regards, tom lane