On 26 March 2013 05:26, Greg Stark <stark@mit.edu> wrote:
> I'm not as sanguine as Tom is about how likely these corner cases will
> be met actually. As far as I can tell checking IS NULL on
> array_length() was the supported way to check for 0-length arrays
> previously
Correct. There was no other way to check for empty arrays, because
every empty array was zero-D, and zero-D returns NULL from all array
interrogation functions, even array_ndims (which is totally bonkers).
>
> At least if it's a clean break then everyone on 9.3 knows they need to
> do IS NULL and everyone on 9.4 knows they need to check for 0.
And, as I pointed out in at the top of the thread, you can write
"coalesce(array_length(a,1), 0) = 0" if you want to be confident your
code will continue work in either case, and for some folks I expect
that will be the least painful way to upgrade from 9.3 -> 9.4.
Cheers,
BJ