Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
Date
Msg-id cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com
Whole thread Raw
In response to Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
List pgsql-hackers
Hello David!

05.11.2025 00:55, David Rowley wrote:
I finally decided that it was a bit too obscure a scenario to test to
verify that the same silly mistake didn't reappear.

Thanks again for the report and the simple recreation steps.

Thank you for the fix!

But while playing around, I've just discovered another interesting error:

SET enable_seqscan = 'off';
SELECT * FROM t EXCEPT SELECT * FROM t
UNION SELECT * FROM pt;

leads to:
ERROR:  XX000: no relation entry for relid 0
LOCATION:  find_base_rel, relnode.c:541

Best regards,
Alexander

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Fix comments for ChangeVarNodes() and related functions
Next
From: Fujii Masao
Date:
Subject: Re: [PATCH] Add archive_mode=follow_primary to prevent unarchived WAL on standby promotion