Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gBUnJ-0005nV-By for pgsql-docs@arkaria.postgresql.org; Sun, 14 Oct 2018 01:02:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gBUnG-0000uz-S7 for pgsql-docs@arkaria.postgresql.org; Sun, 14 Oct 2018 01:02:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gBUnG-0000up-Co for pgsql-docs@lists.postgresql.org; Sun, 14 Oct 2018 01:02:06 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gBUn8-0007QN-Nt for pgsql-docs@postgresql.org; Sun, 14 Oct 2018 01:02:04 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1gBUn7-0003Hu-Km; Sat, 13 Oct 2018 21:01:57 -0400 Date: Sat, 13 Oct 2018 21:01:57 -0400 From: Bruce Momjian To: fn ln Cc: pgsql-docs@postgresql.org Subject: Re: v11: RETURN syntax for procedure Message-ID: <20181014010157.GB25796@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Oct 10, 2018 at 10:14:23PM +0900, fn ln wrote: > Hello. > > I've found this on the docs: > https://www.postgresql.org/docs/devel/static/plpgsql-control-structures.html# > PLPGSQL-STATEMENTS-RETURNING-PROCEDURE > > If a RETURN statement is desired to exit the code early, then NULL must be > returned. > > But isn't actual syntax just RETURN without an expression? I think you might be right: CREATE OR REPLACE PROCEDURE triple() LANGUAGE plpgsql AS $$ BEGIN RETURN NULL; END; $$; ERROR: RETURN cannot have a parameter in a procedure --> LINE 5: RETURN NULL; ^ CREATE OR REPLACE PROCEDURE triple() LANGUAGE plpgsql AS $$ BEGIN RETURN; END; $$; -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +