From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"
Date: Sat, 03 Nov 2018 16:47:31 -0400
Message-ID: <26116.1541278051@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFj8pRB3ZPu_SUDamXGA+wXw2aMmn0oLmgvsdMT1oAyJUMgFZA@mail.gmail.com>
References: <CAFj8pRA6UsujpTs9Sdwmk-R6yQykPx46wgjj+YZ7zxm4onrDyw@mail.gmail.com>
<CAFj8pRBdNqq8+SsChS8F5s9ttkdBSTPu=cq-fLx51FF7Tk_LkA@mail.gmail.com>
<CAFj8pRCF3pia7gScM0jh7vY9rEuqN7fbnUV+jymRTLEXZeRDNA@mail.gmail.com>
<CAFj8pRD2=MGU8ZshvmCjv5KG+3EngRm0+8pFLsjhG5bUhUGU2Q@mail.gmail.com>
<CAFj8pRCehpRXn2vSq8Q+dQL2sQ0XXt0rOukFb0tZ5F7RFdH+DA@mail.gmail.com>
<1d846492-3822-616b-7246-91b429cc5dbb@2ndquadrant.com>
<CAFj8pRB3ZPu_SUDamXGA+wXw2aMmn0oLmgvsdMT1oAyJUMgFZA@mail.gmail.com>
Pavel Stehule <pavel.stehule@gmail.com> writes:
> pá 2. 11. 2018 v 9:02 odesílatel Peter Eisentraut <
> peter.eisentraut@2ndquadrant.com> napsal:
>> Could you explain your analysis of the problem and how this patch
>> proposes to fix it?
> The original code works with original function arguments - and this compare
> with argmodes fields. But when you use named args, this expectation is not
> valid.
Yeah. IMO, the fundamental mistake in this code was to try to avoid
calling expand_function_arguments. The proposed patch still tries to
avoid that, which is why it's still a mess and, I suspect, still fails
on args with default values. You cannot process calls with named args
correctly without accounting for defaults.
I'm going to go see about converting this to just call
expand_function_arguments and then drop all the special-case code.
BTW, it looks to me like ExecuteCallStmt trashes the passed-in CallStmt
in cases where expand_function_arguments is not a no-op. Is that
really safe? Seems to me it'd cause problems if, for example, dealing
with a CallStmt that's part of a prepared stmt or cached plan.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com, peter.eisentraut@2ndquadrant.com
Subject: Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"
In-Reply-To: <26116.1541278051@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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