Re: BUG #4613: intarray_del_elem returns an invalid empty array (for nullif comparison) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4613: intarray_del_elem returns an invalid empty array (for nullif comparison)
Date
Msg-id 28991.1231870924@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4613: intarray_del_elem returns an invalid empty array (for nullif comparison)  ("Valentine Gogichashvili" <valgog@gmail.com>)
Responses Re: BUG #4613: intarray_del_elem returns an invalid empty array (for nullif comparison)
List pgsql-bugs
"Valentine Gogichashvili" <valgog@gmail.com> writes:
> When contrib/intarray module - operation (intarray_del_elem) returns an
> empty array, is not supposed to be empty

This isn't really contrib/intarray's fault, it's a symptom of the
general question of what an "empty" array is.  See thread here:
http://archives.postgresql.org/pgsql-hackers/2008-10/msg01033.php

Given the lack of consensus about how to change the behavior, I wouldn't
recommend holding your breath waiting for a fix --- and in any case
we'd not likely risk back-patching any such change.  Instead of testing
for equality to '{}' you'd probably be better off testing the array
dimensions, as suggested here:
http://archives.postgresql.org/pgsql-general/2008-10/msg00920.php

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Valentine Gogichashvili"
Date:
Subject: BUG #4613: intarray_del_elem returns an invalid empty array (for nullif comparison)
Next
From: "Merlin Moncure"
Date:
Subject: problem with non-greedy regex match