pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
Date: Wed, 5 Nov 2025 06:00:00 +0200
Message-ID: <cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com> (raw)
In-Reply-To: <CAApHDvobsb7zccHrrXS2r-yjZ037-X_QBn1QV7tkyc8O1cUUSw@mail.gmail.com>
References: <CAApHDvri53PPF76c3M94_QNWbJfXjyCnjXuj_2=LYM-0m8WZtw@mail.gmail.com>
	<976130.1759375308@sss.pgh.pa.us>
	<CAApHDvpk88w3MrzgZShROjQw3NPK54YKr_hOi0++0QKGwTq+-g@mail.gmail.com>
	<1064547.1759418336@sss.pgh.pa.us>
	<CAApHDvpVYC43mi8atZ2Q39emK45xh7AaXetMJE9gJyV6sge_mg@mail.gmail.com>
	<1196118.1759438964@sss.pgh.pa.us>
	<CAApHDvrUASy9sfULMEsM2udvZJP6AoBRCZvHYXYxZTy2tX9FYw@mail.gmail.com>
	<bee34aec-659c-46f1-9ab7-7bbae0b7616c@gmail.com>
	<CAApHDvrHPnPFYHprOBSAVZp8BjNBoFtbPuKZrJt8tvSRR6SV4Q@mail.gmail.com>
	<CAApHDvpM7uggy7o1aj+iiMHdfFa17ufnWyZGK25aK6p1Kp0B7w@mail.gmail.com>
	<CAApHDvobsb7zccHrrXS2r-yjZ037-X_QBn1QV7tkyc8O1cUUSw@mail.gmail.com>

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

view thread (23+ messages)  latest in thread

Message-ID: <cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com>
Permalink:  ../cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com/
Also on:    postgresql.org/message-id/cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, dgrowleyml@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
  In-Reply-To: <cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com>
  References: <CAApHDvri53PPF76c3M94_QNWbJfXjyCnjXuj_2=LYM-0m8WZtw@mail.gmail.com> <976130.1759375308@sss.pgh.pa.us> <CAApHDvpk88w3MrzgZShROjQw3NPK54YKr_hOi0++0QKGwTq+-g@mail.gmail.com> <1064547.1759418336@sss.pgh.pa.us> <CAApHDvpVYC43mi8atZ2Q39emK45xh7AaXetMJE9gJyV6sge_mg@mail.gmail.com> <1196118.1759438964@sss.pgh.pa.us> <CAApHDvrUASy9sfULMEsM2udvZJP6AoBRCZvHYXYxZTy2tX9FYw@mail.gmail.com> <bee34aec-659c-46f1-9ab7-7bbae0b7616c@gmail.com> <CAApHDvrHPnPFYHprOBSAVZp8BjNBoFtbPuKZrJt8tvSRR6SV4Q@mail.gmail.com> <CAApHDvpM7uggy7o1aj+iiMHdfFa17ufnWyZGK25aK6p1Kp0B7w@mail.gmail.com> <CAApHDvobsb7zccHrrXS2r-yjZ037-X_QBn1QV7tkyc8O1cUUSw@mail.gmail.com> <cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox