I am just wondering how to write a wrapper function in PostgreSQL (as of 12.x) for a
heterogeneous VARIADIC function such as
Most SQL examples of VARIADIC functions I can find are not heterogeneous. The VARIADIC part is essentially an array of elements of the same type. But I need to write a wrapper for
jsonb_build_object to do some post-processing. Here, the parameter types in the variadic part (key-value list) are not the same.
Currently, I write:
my_func(jsonb_build_object(k1, v1, k2, v2, ...))
But this boilerplate is becoming boring …