RE: BUG #14953: pg_blocking_pids / array_length inconsistency - Mailing list pgsql-bugs

From Steven Winfield
Subject RE: BUG #14953: pg_blocking_pids / array_length inconsistency
Date
Msg-id E9FA92C2921F31408041863B74EE4C2001A46B3347@CCPMAILDAG03.cantab.local
Whole thread Raw
In response to Re: BUG #14953: pg_blocking_pids / array_length inconsistency  (Marko Tiikkaja <marko@joh.to>)
List pgsql-bugs

Thanks - I hadn’t spotted that, even though it was added in 9.4.

 

Steven.

 

From: Marko Tiikkaja [mailto:marko@joh.to]
Sent: 07 December 2017 15:07
To: Steven Winfield
Cc: Pg Bugs
Subject: Re: BUG #14953: pg_blocking_pids / array_length inconsistency

 

On Thu, Dec 7, 2017 at 3:40 PM, <steven.winfield@cantabcapital.com> wrote:

For what it's worth, I think having array_length('{}'::integer[], 1) = 0 is
far more sensible, and
making differently-dimensioned empty arrays compare equal (as mentioned
previously[1]) is quite confusing.

 

I'm not saying this isn't a bug, but you might want to start using the cardinality() function for comparisons like this.

 

 

.m

pgsql-bugs by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: BUG #14953: pg_blocking_pids / array_length inconsistency
Next
From: Tom Lane
Date:
Subject: Re: BUG #14953: pg_blocking_pids / array_length inconsistency