v.20.4New Feature
Added Generic Variants for Least and Greatest Functions to Support Arbitrary Arguments
Added generic variants for functionsleastandgreatest. Now they work with arbitrary number of arguments of arbitrary types. This fixes #4767 #10318 (alexey-milovidov)
Why it matters
This enhancement resolves limitations in the previous implementations ofleast and greatest functions, allowing users to compare multiple values of different types in a single function call. It improves flexibility and usability for switching and filtering logic in queries.How to use it
Use theleast and greatest functions as before, but now you can pass any number of arguments with different types without restrictions. For example:SELECT least(1, 2, 3, 4), greatest('a', 'b', 'c');