Re: BUG #18932: PostgreSQL fails to handle EXCEPT operation when the left branch is an Empty Table - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #18932: PostgreSQL fails to handle EXCEPT operation when the left branch is an Empty Table
Date
Msg-id CAKFQuwb+7_eJSTJOcQ8pL37Dbt=i9FWQnvp+_SQHrBHeiWs2Cg@mail.gmail.com
Whole thread Raw
In response to BUG #18932: PostgreSQL fails to handle EXCEPT operation when the left branch is an Empty Table  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs


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

Bug reference:      18932
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 query:
SELECT * FROM empty_table EXCEPT SELECT * FROM not_empty_table;
Obviously, the above query always returns an empty set. I think it should
return an empty set quickly. 

The failure to do so is not a bug.  See other similar complaints in the past month or so.

Patches in this area could be accepted but the corner cases being described don't seem to be highly motivating.

David J.

pgsql-bugs by date:

Previous
From: 萧鸿骏
Date:
Subject: Re: Re: BUG #18927: Poor query plan - HashAggregate is more than twice as fast but at a higher cost
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #18930: PostgreSQL fails to handle INTERSECT operation involving Empty Table