postgresql/src/backend
Tom Lane 991a3df227 Fix filtering of "cloned" outer-join quals some more.
We've had multiple issues with the clause_is_computable_at logic that
I introduced in 2489d76c4: it's been known to accept more than one
clone of the same qual at the same plan node, and also to accept no
clones at all.  It's looking impractical to get it 100% right on the
basis of the currently-stored information, so fix it by introducing a
new RestrictInfo field "incompatible_relids" that explicitly shows
which outer joins a given clone mustn't be pushed above.

In principle we could populate this field in every RestrictInfo, but
that would cost space and there doesn't presently seem to be a need
for it in general.  Also, while deconstruct_distribute_oj_quals can
easily fill the field with the remaining members of the commutative
join set that it's considering, computing it in the general case
seems again pretty complicated.  So for now, just fill it for
clone quals.

Along the way, fix a bug that may or may not be only latent:
equivclass.c was generating replacement clauses with is_pushed_down
and has_clone/is_clone markings that didn't match their
required_relids.  This led me to conclude that leaving the clone flags
out of make_restrictinfo's purview wasn't such a great idea after all,
so add them.

Per report from Richard Guo.

Discussion: https://postgr.es/m/CAMbWs48EYi_9-pSd0ORes1kTmTeAjT4Q3gu49hJtYCbSn2JyeA@mail.gmail.com
2023-05-25 10:28:33 -04:00
..
access Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
bootstrap Fix CREATE INDEX progress reporting for multi-level partitioning. 2023-03-25 15:34:03 -04:00
catalog Expand some more uses of "deleg" to "delegation" or "delegated". 2023-05-21 10:55:18 -04:00
commands Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
executor Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
foreign Expand some more uses of "deleg" to "delegation" or "delegated". 2023-05-21 10:55:18 -04:00
jit Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
lib Fix ILIST_DEBUG build 2023-01-18 10:26:15 -08:00
libpq rename "gss_accept_deleg" to "gss_accept_delegation". 2023-05-20 21:32:54 -04:00
main Remove obsolete defense against strxfrm() bugs. 2023-04-20 13:20:14 +12:00
nodes Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
optimizer Fix filtering of "cloned" outer-join quals some more. 2023-05-25 10:28:33 -04:00
parser Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
partitioning Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
po Translation updates 2023-05-22 12:44:31 +02:00
port Update copyright for 2023 2023-01-02 15:00:37 -05:00
postmaster Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
regex Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
replication Optimize walsender wake up logic using condition variables 2023-05-21 09:44:55 -07:00
rewrite Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
snowball Fix the install rule for snowball_create.sql. 2023-05-23 11:15:57 -04:00
statistics Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
storage Remove over-eager assertion in ExtendBufferedRelTo() 2023-05-21 09:53:49 -07:00
tcop Handle logical slot conflicts on standby 2023-04-08 00:05:44 -07:00
tsearch Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
utils Use lower case for icu_validation_level values 2023-05-23 15:19:33 +02:00
.gitignore
Makefile Redesign archive modules 2023-02-17 14:26:42 +09:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build meson: Prevent installation of test files during main install 2023-03-03 07:45:52 +01:00
nls.mk Add missing gettext triggers 2023-05-10 13:51:51 +02:00