function format doesn't support values with variadic flag - Mailing list pgsql-bugs

From Pavel Stehule
Subject function format doesn't support values with variadic flag
Date
Msg-id CAFj8pRBnYT7Wr-iLJcDC_Pz_+9Unj0WRZCTWDr8Hf_oc5CkozQ@mail.gmail.com
Whole thread Raw
List pgsql-bugs
Hello

this code should to work, but it doesn't

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

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

postgres=3D# select un(variadic array[1,2,3]);
 un
=E2=94=80=E2=94=80=E2=94=80=E2=94=80
  1
  2
  3
(3 rows)

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

Regards

Pavel Stehule

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Core was generated by `postgres: kazeon KazDB 192.168.50.131(37625) SELECT '.
Next
From: murrayc@murrayc.com
Date:
Subject: BUG #7514: postgres -k no longer works with spaces in the path