BUG #16547: ECPG can't CALL the procedure which has INOUT parameter

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: egashira(dot)yusuke(at)jp(dot)fujitsu(dot)com
Subject: BUG #16547: ECPG can't CALL the procedure which has INOUT parameter
Date: 2020-07-21 07:44:54
Message-ID: 16547-0d8cd56ecb46f943@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16547
Logged by: yusuke egashira
Email address: egashira(dot)yusuke(at)jp(dot)fujitsu(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2020-07-21 09:12:44 Re: pg_dump's "--exclude-table" and "--exclude-table-data" options are ignored and/or cause the dump to fail entirely unless both the schema and table name use 1950s-era identifiers.
Previous Message David G. Johnston 2020-07-21 06:59:27 Re: pg_dump's "--exclude-table" and "--exclude-table-data" options are ignored and/or cause the dump to fail entirely unless both the schema and table name use 1950s-era identifiers.