Skip site navigation (1) Skip section navigation (2)

Re: BUG #4956: Array Construct array() returning blank result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Niranjan Pandit" <niranjan81(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4956: Array Construct array() returning blank result
Date: 2009-07-31 14:09:41
Message-ID: 18694.1249049381@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Niranjan Pandit" <niranjan81(at)gmail(dot)com> writes:
> Only when the condition gets evaluated to true with at least 2 columns with
> varying values the array gets constructed, in all other cases what we get is
> a complete blank output. the label of the result is as usual as ?column? but
> there is absolutely nothing in the cell below the label.

Hmm, seems to work for me:

regression=# select array(select unique1 from tenk1 where unique2 < 2);
  ?column?   
-------------
 {8800,1891}
(1 row)

regression=# select array(select unique1 from tenk1 where unique2 < 1);
 ?column? 
----------
 {8800}
(1 row)

regression=# select array(select unique1 from tenk1 where unique2 < 0);
 ?column? 
----------
 {}
(1 row)

Pre-8.3 PG releases would return NULL instead of an empty array in the
last case, but 8,4 should not.  If you're seeing differently, we'll
need a self-contained test case.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Luke KoopsDate: 2009-07-31 14:59:56
Subject: BUG #4958: Stats collector hung on WaitForMultipleObjectsEx while attempting to recv a datagram
Previous:From: Tom LaneDate: 2009-07-31 13:59:43
Subject: Re: BUG #4957: search_path and pg_dump -T switch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group