pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: BUG #16547: ECPG can't CALL the procedure which has INOUT parameter
3+ messages / 2 participants
[nested] [flat]

* Re: BUG #16547: ECPG can't CALL the procedure which has INOUT parameter
@ 2020-08-22 00:59  Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Bruce Momjian @ 2020-08-22 00:59 UTC (permalink / raw)
  To: egashira.yusuke@jp.fujitsu.com; pgsql-bugs@lists.postgresql.org; +Cc: Michael Meskes <meskes@postgresql.org>

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%40...

This looks like something we should either fix or document.  Michael
Meskes, do you have an opinion?

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #16547: ECPG can't CALL the procedure which has INOUT parameter
@ 2020-08-22 15:52  Michael Meskes <meskes@postgresql.org>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Meskes @ 2020-08-22 15:52 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; egashira.yusuke@jp.fujitsu.com; pgsql-bugs@lists.postgresql.org

> > ...
> > 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%40...
> 
> This looks like something we should either fix or document.  Michael
> Meskes, do you have an opinion?

Yes, I think it should definitely be fixed. In fact I was looking into
it and iirc the patch mentioned had a couple issues but could be a good
base for the fix. Unfortunately I have not found the time yet to take
care of it.

So in short, hopefully we can fix it shortly.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De
Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #16547: ECPG can't CALL the procedure which has INOUT parameter
@ 2020-08-22 16:54  Bruce Momjian <bruce@momjian.us>
  parent: Michael Meskes <meskes@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Bruce Momjian @ 2020-08-22 16:54 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; +Cc: egashira.yusuke@jp.fujitsu.com; pgsql-bugs@lists.postgresql.org

On Sat, Aug 22, 2020 at 05:52:23PM +0200, Michael Meskes wrote:
> > > ...
> > > 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%40...
> > 
> > This looks like something we should either fix or document.  Michael
> > Meskes, do you have an opinion?
> 
> Yes, I think it should definitely be fixed. In fact I was looking into
> it and iirc the patch mentioned had a couple issues but could be a good
> base for the fix. Unfortunately I have not found the time yet to take
> care of it.
> 
> So in short, hopefully we can fix it shortly.

Thank you.  I am glad you are aware of it.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-08-22 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 00:59 Re: BUG #16547: ECPG can't CALL the procedure which has INOUT parameter Bruce Momjian <bruce@momjian.us>
2020-08-22 15:52 ` Michael Meskes <meskes@postgresql.org>
2020-08-22 16:54   ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox