function format doesn't support values with variadic flag

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: function format doesn't support values with variadic flag
Date: 2012-09-04 05:05:36
Message-ID: CAFj8pRBnYT7Wr-iLJcDC_Pz_+9Unj0WRZCTWDr8Hf_oc5CkozQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello

this code should to work, but it doesn't

postgres=# select format('%s %s', variadic array['Hello','World']);
ERROR: too few arguments for format

postgres=# create or replace function un(variadic integer[])
postgres-# returns setof int as $$ select unnest($1)$$ language sql;
CREATE FUNCTION
postgres=# select un(1,2,3,4);
un
────
1
2
3
4
(4 rows)

postgres=# select un(variadic array[1,2,3]);
un
────
1
2
3
(3 rows)

A problem is in too simple evaluation of "any" parameter - without
check to "VARIADIC" flag

Regards

Pavel Stehule

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2012-09-04 07:03:47 Re: BUG #7517: terminated by exception 0xC0000409
Previous Message katsuhito.habaguchi 2012-09-04 01:00:21 BUG #7517: terminated by exception 0xC0000409