Hello

This patch disable bypassing of parameters for variadic function with
"ANY" type variadic parameter. Now - this functionality is just
broken. Because there are no any requests for fixing this issue, I
propose the most simply solution - just disable using this type of
variadic function when variadic variables are not expanded. Internally
it has impact to "format" function only. There are no possibility put
parameters in array. But this possibility can be useful. I cannot to
use overloading due ambiguous functions with "any" and "anyarray"
params. Solution can be new function "format_array" - that share code
with "format" function.

postgres=# select format_array('Hello %s, %1$s', array['World']);
    format_array
--------------------
 Hello World, World
(1 row)

postgres=# select format('Hello %s, %1$s', variadic array['World']);
ERROR:  function format(unknown, text[]) does not exist
LINE 1: select format('Hello %s, %1$s', variadic array['World']);
               ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.
postgres=# select format('Hello %s, %1$s', 'World');
       format
--------------------
 Hello World, World
(1 row)

Regards

Pavel Stehule

Attachment: text_format_array.diff
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to