Process variadic arguments consistently in json functions

Andrew Dunstan <andrew@dunslane.net>

Commit: 18fc4ecf4afafe40bd7e7577bd611e5caf74c9fd
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2017-10-25T11:34:00Z
Releases: 11.0
Process variadic arguments consistently in json functions

json_build_object and json_build_array and the jsonb equivalents did not
correctly process explicit VARIADIC arguments. They are modified to use
the new extract_variadic_args() utility function which abstracts away
the details of the call method.

Michael Paquier, reviewed by Tom Lane and Dmitry Dolgov.

Backpatch to 9.5 for the jsonb fixes and 9.4 for the json fixes, as
that's where they originated.

Files