Re: BUG #15922: Simple select with multiple exists filters returns duplicates from a primary key field - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15922: Simple select with multiple exists filters returns duplicates from a primary key field
Date
Msg-id 7671.1563904324@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15922: Simple select with multiple exists filters returns duplicates from a primary key field  (PG Bug reporting form <noreply@postgresql.org>)
Responses RE: BUG #15922: Simple select with multiple exists filters returnsduplicates from a primary key field  (David Raymond <David.Raymond@tomtom.com>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> I have a case where I'm doing a simple select from a table but I'm getting
> returned duplicates from its primary key field when I have two different
> exists statements in the where clause.

Hm.  Seems like pretty clearly a planner bug --- the second plan seems
to be missing the de-duplication step that's done by the HashAggregate
in the first plan.  But I don't want to try to reproduce it with just
the info in this report.  Can you generate dummy or sanitized data to
make a self-contained test case that reproduces the problem?

It'd be useful to know also if the problem goes away if you disable
parallel query (SET max_parallel_workers_per_gather = 0, for instance).

Also, does the issue go away if you drop either or both of the foreign
key constraints?

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: A function privilege problem
Next
From: Tom Lane
Date:
Subject: Re: DROP STATISTICS results in "ERROR: tuple concurrently updated"