fix - function call with variadic parameter for type "any" - Mailing list pgsql-hackers

From Pavel Stehule
Subject fix - function call with variadic parameter for type "any"
Date
Msg-id 162867790903300534i6add12e1x840be75db6881088@mail.gmail.com
Whole thread Raw
Responses Re: fix - function call with variadic parameter for type "any"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello,

Our implementation of variadic parameters are not complete. The
support of "any" type is incomplete. Modificator VARIADIC for funccall
parameters needs transformation from ArrayExpr to standard parameters
list.

==current behave==
postgres=# select variadic_demo2(10,'Petr',20,20,30);
NOTICE:  arg(0) = 10
NOTICE:  arg(1) = Petr
NOTICE:  arg(2) = 20
NOTICE:  arg(3) = 20
NOTICE:  arg(4) = 30
 variadic_demo2
----------------

(1 row)

Time: 3,245 ms
postgres=# select variadic_demo2(10,'Petr',20, variadic array[10,20]);
NOTICE:  arg(0) = 10
NOTICE:  arg(1) = Petr
NOTICE:  arg(2) = 20
NOTICE:  arg(3) = {10,20}
 variadic_demo2
----------------

(1 row)

==fixed behave==

Time: 1,287 ms
postgres=# select variadic_demo2(10,'Petr',20,20,30);
NOTICE:  arg(0) = 10
NOTICE:  arg(1) = Petr
NOTICE:  arg(2) = 20
NOTICE:  arg(3) = 20
NOTICE:  arg(4) = 30
 variadic_demo2
----------------

(1 row)

Time: 0,994 ms
postgres=# select variadic_demo2(10,'Petr',20, variadic array[10,20]);
NOTICE:  arg(0) = 10
NOTICE:  arg(1) = Petr
NOTICE:  arg(2) = 20
NOTICE:  arg(3) = 10
NOTICE:  arg(4) = 20
 variadic_demo2
----------------

(1 row)

regards
Pavel Stehule

Attachment

pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: PQinitSSL broken in some use casesf
Next
From: Heikki Linnakangas
Date:
Subject: More message encoding woes