From: tom@tomforb.es
To: pgsql-bugs@postgresql.org
Subject: BUG #7550: NULL result when coercing a subquery result into an array
Date: Mon, 17 Sep 2012 19:32:30 +0000
Message-ID: <E1TDh3W-0004tQ-F9@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 7550
Logged by: Tom Forbes
Email address: tom@tomforb.es
PostgreSQL version: 9.2.0
Operating system: Windows 8
Description:
Hello,
I wasn't sure how to title this report so apologies if it is incorrect or
misleading.
I have two queries:
http://pgsql.privatepaste.com/7d1473defahttp://pgsql.privatepaste.com/85e1d43b7a
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
int[].
The base query with no values can be found here:
http://pgsql.privatepaste.com/1ebe2d7646
And the EXPLAIN ANALYZE VERBOSE of the queries can be found here:
http://pgsql.privatepaste.com/a4b8b622c5 <-- Returns int[]
http://pgsql.privatepaste.com/525fda6340 <-- 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
results.
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tom@tomforb.es
Subject: Re: BUG #7550: NULL result when coercing a subquery result into an array
In-Reply-To: <E1TDh3W-0004tQ-F9@wrigleys.postgresql.org>
References: <E1TDh3W-0004tQ-F9@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox