Add num_nulls() and num_nonnulls() to count NULL arguments.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 6819514fca22f8554edcab6e4d0402b0221f03bb
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2016-02-05T04:03:37Z
Releases: 9.6.0
Add num_nulls() and num_nonnulls() to count NULL arguments.

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

Files

Documentation touched