fix - function call with variadic parameter for type "any"

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: fix - function call with variadic parameter for type "any"
Date: 2009-03-30 12:34:43
Message-ID: 162867790903300534i6add12e1x840be75db6881088@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
variadic_any.diff text/x-patch 1.8 KB
varidic_test.tgz application/x-gzip 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-03-30 12:52:37 More message encoding woes
Previous Message Thomas Kellerer 2009-03-30 12:33:12 Re: New shapshot RPMs (Mar 27, 2009) are ready for testing