The following bug has been logged online:
Bug reference: 5472
Logged by: Vlad Romascanu
Email address: vromascanu@accurev.com
PostgreSQL version: 8.4.3
Operating system: Windows, Linux
Description: Postgres hard crash in ...WHERE <bigint_col> IN (SELECT
* FROM (VALUES (<int_value>),...) AS t(col))
Details:
The following reproducibly crashes Postgres 8.4.3 (segfault) inside
int84eq() on both Windows and Linux, but works just fine in 8.3.4:
CREATE TABLE t1 (
col1 bigint NOT NULL,
col2 integer NOT NULL,
CONSTRAINT t1_pkey PRIMARY KEY (col1, col2)
);
INSERT INTO t1 (col1, col2) VALUES (0,1),(1,2),(2,3);
SELECT col1, col2 FROM t1 WHERE col1 IN ( SELECT * FROM (VALUES (1),(2)) AS
t2(col1) )
Changing the above to...
SELECT col1, col2 FROM t1 WHERE col1::integer IN ( SELECT * FROM (VALUES
(1),(2)) AS t2(col1) )
...works again.