Re: missing support of named convention for procedures - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: missing support of named convention for procedures
Date
Msg-id ef1fdaff-22d7-91ca-03c1-4bddec49afc3@2ndquadrant.com
Whole thread Raw
In response to Re: missing support of named convention for procedures  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: missing support of named convention for procedures  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
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.

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


pgsql-hackers by date:

Previous
From: Michail Nikolaev
Date:
Subject: Re: [WIP PATCH] Index scan offset optimisation using visibility map
Next
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] [PATCH] Incremental sort