On 1 April 2013 21:57, Robert Haas <robertmh...@gmail.com> wrote: > On Tue, Mar 26, 2013 at 4:39 PM, Brendan Jurd <dire...@gmail.com> wrote: >> On 27 March 2013 06:47, Robert Haas <robertmh...@gmail.com> wrote: >>> rhaas=# select '{}'::int4[] = '{}'::int4[]; >> >> The good news is, if anybody out there is using that idiom to test for >> emptiness, they will not be disrupted by the change. > > According to the discussion downthread, apparently they will, because > you're introducing an infinitude of empty arrays, not all of which > compare equal to '{}'::int4.
It is not possible to construct e.g. '[3:2]={}' or '{{}, {}}' in existing applications, so there is no way for that idiom in existing applications to be broken by upgrading. If testing for equality with '{}' works now, it will also work post-upgrade. The only way for it to stop working is if somebody upgrades, and *then* goes out of their way to create an empty array with nondefault lower bounds, and then tries to compare that array against the empty array with default lower bounds, to test for emptiness. Which would be silly. Big picture: A very large number of users wouldn't be using arrays at all, and of those who are, probably a vanishingly small number (perhaps zero) care about how emptiness interacts with multiple dimensions or nondefault lower bounds. We're talking about a corner case inside a corner case here. For most folks, this upgrade would break nothing. A few (myself included) will want to grep their code for array_(lower|upper|length|dims) call sites and maybe make some tweaks. Cheers, BJ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers