postgresql/src/include
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 Fix some typos and some incorrectly duplicated words 2023-04-18 14:03:49 +12:00
bootstrap Update copyright for 2023 2023-01-02 15:00:37 -05:00
catalog Expand some more uses of "deleg" to "delegation" or "delegated". 2023-05-21 10:55:18 -04:00
commands Revert "Catalog NOT NULL constraints" and fallout 2023-04-12 19:29:21 +02:00
common Remove stray mid-sentence tabs in comments 2023-05-19 16:13:16 +02:00
datatype Code review for commit 05a7be935. 2023-01-26 12:51:00 -05:00
executor Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
fe_utils Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
foreign Update copyright for 2023 2023-01-02 15:00:37 -05:00
jit Update copyright for 2023 2023-01-02 15:00:37 -05:00
lib Fix various typos in code and tests 2023-02-09 14:43:53 +09:00
libpq rename "gss_accept_deleg" to "gss_accept_delegation". 2023-05-20 21:32:54 -04:00
mb Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodes Fix filtering of "cloned" outer-join quals some more. 2023-05-25 10:28:33 -04:00
optimizer Fix filtering of "cloned" outer-join quals some more. 2023-05-25 10:28:33 -04:00
parser Fix crashes with CREATE SCHEMA AUTHORIZATION and schema elements 2023-04-28 19:29:12 +09:00
partitioning Revert "Move PartitionPruneInfo out of plan nodes into PlannedStmt" 2023-05-04 12:09:59 +02:00
pch Update copyright for 2023 2023-01-02 15:00:37 -05:00
port Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
portability instr_time: Represent time as an int64 on all platforms 2023-01-20 21:16:47 -08:00
postmaster Fix wal_writer_flush_after initializer value. 2023-05-15 11:19:54 +12:00
regex Fix various typos 2023-04-18 13:23:23 +12:00
replication Optimize walsender wake up logic using condition variables 2023-05-21 09:44:55 -07:00
rewrite Make Vars be outer-join-aware. 2023-01-30 13:16:20 -05:00
snowball Update copyright for 2023 2023-01-02 15:00:37 -05:00
statistics Update copyright for 2023 2023-01-02 15:00:37 -05:00
storage Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
tcop Update copyright for 2023 2023-01-02 15:00:37 -05:00
tsearch Update tsearch regex memory management. 2023-04-08 22:09:17 +12:00
utils rename "gss_accept_deleg" to "gss_accept_delegation". 2023-05-20 21:32:54 -04:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
Makefile Include headers of archive/ in installation 2023-03-10 20:08:10 +09:00
c.h Introduce PG_IO_ALIGN_SIZE and align all I/O buffers. 2023-04-08 16:34:50 +12:00
fmgr.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
funcapi.h Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
getopt_long.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
meson.build Include headers of archive/ in installation 2023-03-10 20:08:10 +09:00
miscadmin.h Add VACUUM/ANALYZE BUFFER_USAGE_LIMIT option 2023-04-07 11:40:31 +12:00
pg_config.h.in Further cleanup of autoconf output files for GSSAPI changes. 2023-04-17 11:21:50 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Fix typos in comments 2023-05-02 12:23:08 +09:00
pg_getopt.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_trace.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgstat.h Add writeback to pg_stat_io 2023-05-17 11:18:35 -07:00
pgtar.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgtime.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
port.h Add SHELL_ERROR and SHELL_EXIT_CODE magic variables to psql. 2023-03-21 13:03:56 -04:00
postgres.h New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
varatt.h New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
windowapi.h Update copyright for 2023 2023-01-02 15:00:37 -05:00