Having new VARIADIC functions, I decided it would be cool to be able to write sprintf() function. Basically the idea is simple, plperl function, which takes "format", and list of arguments and returns generated output.

Pavel Stehule wrote, and then Tom Lane committed (on 16th of July), patch which adds to PostgreSQL support for functions with variable number of arguments.