Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean" - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"
Date
Msg-id 28551.1541281624@sss.pgh.pa.us
Whole thread Raw
In response to Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: bugfix: BUG #15477: Procedure call with named inout refcursorparameter - "invalid input syntax for type boolean"
List pgsql-hackers
I wrote:
> I'm going to go see about converting this to just call
> expand_function_arguments and then drop all the special-case code.

So while looking at that ... isn't the behavior for non-writable output
parameters basically insane?  It certainly fails to accord with the
plpgsql documentation, which shows an example that would throw an error:

    CREATE PROCEDURE triple(INOUT x int)
    ...
    CALL triple(5);

It's even weirder that you can get away with not supplying a writable
target value for an output argument so long as it has a default.

I think the behavior here ought to be "if the actual argument is a plpgsql
variable, assign the output back to it, otherwise do nothing".  That's
much closer to the behavior of OUT arguments in other old-school
programming languages.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Andreas 'ads' Scherbaum
Date:
Subject: Re: [PATCH] Improvements to "Getting started" tutorial for GoogleCode-in task
Next
From: Andres Freund
Date:
Subject: Reduce maintenance burden of alternative output files with \if \quit