Re: v16 regression - wrong query results with LEFT JOINs + join removal

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2023-05-11T13:56:59Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> While merging commits from c9f7f926484d69e2806e35343af7e472fadfede7
> through 3db72ebcbe20debc6552500ee9ccb4b2007f12f8 into a fork, my
> colleague Rushabh Lathia and I noticed that the merge caused certain
> queries to return wrong answers.

I believe this is a variant of the existing open issue about
the outer-join-Vars stuff:

https://www.postgresql.org/message-id/flat/0b819232-4b50-f245-1c7d-c8c61bf41827%40postgrespro.ru

although perhaps different in detail --- EXPLAIN shows that the
join condition has gone missing completely, rather than just
being put at the wrong join level.  Possibly related to the
join removal that happened to pg_db_role_setting?

I've been incredibly distracted by $real-life over the past few
weeks, but am hoping to get the outer-join-Vars issues resolved
in the next day or two.

			regards, tom lane



Commits

  1. Undo faulty attempt at not relying on RINFO_IS_PUSHED_DOWN.

  2. Generate code for query jumbling through gen_node_support.pl

  3. Allow REPLICA IDENTITY to be set on an index that's not (yet) valid.