What does VARIADIC declarations mean in postgreSQL?

PostgreSQL 9.3.4 release notes say:

Ensure that the planner sees equivalent VARIADIC and non-VARIADIC function calls as equivalent (Tom Lane) 

I searched the PostgreSQL manual and could not find a definition of what it is.

I found that he implemented the function argument mode (IN, OUT, VARIADIC), but I did not understand what this means? When do I want to use it? and what does this mean in terms of performance if a function has a VARIADIC property?

+6
source share
2 answers

Variad functions are functions with the number of arguments undefined; they are present in many programming languages ​​and queries.

In the case of PostgreSQL, you can find an example at http://www.postgresql.org/docs/9.1/static/xfunc-sql.html (35.4.5. SQL Functions with Variable Arguments)

Effectively, all actual arguments at or outside the VARIADIC position are put together in a one-dimensional array, as if you had written

+4
source

When you are not sure about the number of parameters, we use Variadic.

Learn more about VARIADIC FUNCTIONS IN POSTGRESQL .

See the wiki about Variadic Functions :

In computer programming, the variational function is an indefinite function, i.e. one that takes a variable number of arguments. Support for variational functions varies widely among programming languages.

+3
source

All Articles