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 1k9Ht2-0007XD-VG for pgsql-bugs@arkaria.postgresql.org; Sat, 22 Aug 2020 01:00:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k9Ht0-0004Hv-NY for pgsql-bugs@arkaria.postgresql.org; Sat, 22 Aug 2020 00:59:58 +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 1k9Ht0-0004Hn-HW for pgsql-bugs@lists.postgresql.org; Sat, 22 Aug 2020 00:59:58 +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 1k9Hsy-00032h-8o; Sat, 22 Aug 2020 00:59:57 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1k9Hsw-0005lZ-BU; Fri, 21 Aug 2020 20:59:54 -0400 Date: Fri, 21 Aug 2020 20:59:54 -0400 From: Bruce Momjian To: egashira.yusuke@jp.fujitsu.com, pgsql-bugs@lists.postgresql.org Cc: Michael Meskes Subject: Re: BUG #16547: ECPG can't CALL the procedure which has INOUT parameter Message-ID: <20200822005954.GP13363@momjian.us> References: <16547-0d8cd56ecb46f943@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16547-0d8cd56ecb46f943@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Jul 21, 2020 at 07:44:54AM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 16547 > Logged by: yusuke egashira > Email address: egashira.yusuke@jp.fujitsu.com > PostgreSQL version: 11.8 > Operating system: Red Hat Enterprise Linux Server release 6.10 > Description: > > I created the procedure with INOUT parameter as : > CREATE OR REPLACE PROCEDURE inout_proc(a in int, b inout int) > LANGUAGE plpgsql AS $$ > BEGIN > b = a + b; > RETURN; > END; > $$; > > If I called it in ECPG by "EXEC SQL CALL inout_proc(1,2);", "SQL error: too > few arguments on line xx" is caused. > > On the other hand, if the procedure don't have INOUT parameter (IN only), > "EXEC SQL CALL inout_proc(1,2);" statement succeeded. > > This error seems to occur because ECPG doesn't expect the value to be > returned by CALL statement. > Is this a bug? > Or, is the current version limited to calling procedures with INOUT > parameters from ECPG? > > I found this behavior in PostgreSQL 11.8 and 12.3. > > > Also, I found the patch[1] introducing "INTO" clause in CALL of ECPG. > However, the patch changes the EXC SQL CALL statement to always require INTO > clause. > > [1] > https://www.postgresql.org/message-id/CAE9k0P%3DGQFjfy9jHCPDw4Eh_xE%3DNw%3D9y4f-CuTZp1L%2B6vEHwFg%40mail.gmail.com This looks like something we should either fix or document. Michael Meskes, do you have an opinion? -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee