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

BUG #7550: NULL result when coercing a subquery result into an array

From: tom(at)tomforb(dot)es
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #7550: NULL result when coercing a subquery result into an array
Date: 2012-09-17 19:32:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      7550
Logged by:          Tom Forbes
Email address:      tom(at)tomforb(dot)es
PostgreSQL version: 9.2.0
Operating system:   Windows 8

I wasn't sure how to title this report so apologies if it is incorrect or

I have two queries:

The first query returns NULL and the second one returns an int[] with 623
elements in it. The only difference between the two queries is the last
string - 'J. P. Bickella' returns NULL and 'J. P. Bickell' returns an

The base query with no values can be found here:
And the EXPLAIN ANALYZE VERBOSE of the queries can be found here: <-- Returns int[] <-- Returns NULL

In summary: Changing the last (or second to last) element of the second IN
clause causes the query to return an array as expected, whereas setting it
to 'J. P. Bickella' causes it to return NULL.

Executing the query without wrapping it in an array() returns the expected

If needed I can host the database this query is executing on for people to
download upon request, but it is 1.2gb in size.


pgsql-bugs by date

Next:From: teDate: 2012-09-17 20:24:10
Subject: Re: how to proccess record returning null
Previous:From: petskuDate: 2012-09-17 18:51:50
Subject: BUG #7549: max_connections check should query master when startingstandby

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