Re: missing support of named convention for procedures

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: missing support of named convention for procedures
Date: 2018-03-22 14:19:12
Message-ID: CAFj8pRDsc+TXtRvECLVcyAxdZFhtSx+yvmYOVY4APgO9ZzRtbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2018-03-21 8:18 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

>
>
> 2018-03-20 17:31 GMT+01:00 Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)
> com>:
>
>> On 3/16/18 06:29, Pavel Stehule wrote:
>> > attached patch fixes it
>>
>> The fix doesn't seem to work for LANGUAGE SQL procedures. For example:
>>
>> CREATE PROCEDURE ptest5(a int, b int DEFAULT 0)
>> LANGUAGE SQL
>> AS $$
>> INSERT INTO cp_test VALUES (a, 'foo');
>> INSERT INTO cp_test VALUES (b, 'bar');
>> $$;
>> CALL ptest5(a => 1, b => 2); -- ok
>> CALL ptest5(b => 3, a => 4); -- ok
>> CALL ptest5(5);
>> ERROR: no value found for parameter 2
>> CONTEXT: SQL function "ptest5" statement 2
>> CALL ptest5(a => 6);
>> ERROR: no value found for parameter 2
>> CONTEXT: SQL function "ptest5" statement 2
>>
>> I'm not quite sure why this behaves differently from plpgsql. Needs
>> more digging.
>>
>
> Do you working on this issue? Maybe tomorrow I'll have a time to look
> there.
>

attached patch should to fix it

Regards

Pavel

>
> Regards
>
> Pavel
>
>
>>
>> --
>> Peter Eisentraut http://www.2ndQuadrant.com/
>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>>
>
>

Attachment Content-Type Size
call-named-default-args.patch text/x-patch 10.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2018-03-22 14:21:18 Re: WIP: a way forward on bootstrap data
Previous Message Magnus Hagander 2018-03-22 14:07:36 Re: [PATCH] Verify Checksums during Basebackups