Re: BUG #18930: PostgreSQL fails to handle INTERSECT operation involving Empty Table - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #18930: PostgreSQL fails to handle INTERSECT operation involving Empty Table
Date
Msg-id CAKFQuwY1KCd+dVGPFPjAs=X4-YgCGL7LLbfGmF5cirrKwRDJbw@mail.gmail.com
Whole thread Raw
In response to BUG #18930: PostgreSQL fails to handle INTERSECT operation involving Empty Table  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs


On Thu, May 15, 2025, 07:27 PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      18930
Logged by:          jinhui lai
Email address:      jinhuilai@email.ncu.edu.cn
PostgreSQL version: 17.5
Operating system:   ubuntu 22.04
Description:       

Hi, PostgreSQL Developers,
Please consider such queries:
SELECT * FROM empty_table INTERSECT SELECT * FROM not_empty_table;
SELECT * FROM not_empty_table INTERSECT SELECT * FROM empty_table;
Obviously, the above queries always returns an empty set. I think it should
return an empty set quickly. 

Also not a bug.

David J.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #18932: PostgreSQL fails to handle EXCEPT operation when the left branch is an Empty Table
Next
From: Tom Lane
Date:
Subject: Re: BUG #18933: PostgreSQL fails to handle JOIN operation involving Empty Table