D
D
Dmitry Skogorev2016-10-20 22:32:08
PostgreSQL
Dmitry Skogorev, 2016-10-20 22:32:08

How to create a function in postgresql with an unknown number of arguments and unknown types?

Good day everyone.
I don’t understand how to create functions with a variable number of arguments -
now I customize a separate function for each specific case, but I understand that this is a crutch.
it can be function(int, bool, int), or it can be function (bool, int, bool, int) - I want to cast to one type already inside the function.
Tell me how to arrange everything correctly?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Papa, 2016-10-20
@EnterSandman

https://www.postgresql.org/docs/current/static/xfu...
Roll up to 36.4.10. Polymorphic SQL Functions
But this is a direct path to hell.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question