BUG #14471: PostgreSQL 9.6 "NOT IN" in select causes crash with "ERROR: unknown error"

From: josef(dot)machytka(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14471: PostgreSQL 9.6 "NOT IN" in select causes crash with "ERROR: unknown error"
Date: 2016-12-21 09:44:43
Message-ID: 20161221094443.25614.47807@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14471
Logged by: Josef Machytka
Email address: josef(dot)machytka(at)gmail(dot)com
PostgreSQL version: 9.6.1
Operating system: Debian jessie
Description:

I checked stackoverflow and I found several questions complaining about
problems with "NOT IN" causing problems in selects.

Looks like PostgreSQL 9.6 now very probably has some bug connected with "NOT
IN" command. We have select which actually crashes after several hours (!)
of run with message "ERROR: unknown error". Although according to explain
plan it should be done in ~40 minutes.

It is also possible that problem happens only when working with partitioned
tables. We have several sets of partitioned tables. Partitions are by months
- data are used for billing calculations.

Our select which crashes pg 9.6 is like this:

select <some columns>
from table_1_partition t1
inner join table_2 t2 --also partitioned table
on ....
where (t1.col1, t2.col1, t1.col2) NOT IN
(select col1, col2, col3
from table_3 --also partitioned table
group by col1, col2, col3)

When I remove NOT IN part everything works OK. Of course I replaced this
problematic part with NOT EXISTS construct. But "unknown error" crash with
"NOT IN" command is very unfortunate.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrea Urbani 2016-12-21 11:35:56 pg_dump: patterns and tables with uppercase letters
Previous Message Tom Lane 2016-12-21 00:30:57 Re: BUG #14470: Dropping a column produces "table row type and query-specified row type do not match" error