• Tom Lane's avatar
    Add num_nulls() and num_nonnulls() to count NULL arguments. · 6819514f
    Tom Lane authored
    An example use-case is "CHECK(num_nonnulls(a,b,c) = 1)" to assert that
    exactly one of a,b,c isn't NULL.  The functions are variadic, so they
    can also be pressed into service to count the number of null or nonnull
    elements in an array.
    
    Marko Tiikkaja, reviewed by Pavel Stehule
    6819514f
misc_functions.sql 1.1 KB