postgresql/src/backend
Tom Lane 29f114b6ff Allow subquery pullup to wrap a PlaceHolderVar in another one.
The code for wrapping subquery output expressions in PlaceHolderVars
believed that if the expression already was a PlaceHolderVar, it was
never necessary to wrap that in another one.  That's wrong if the
expression is underneath an outer join and involves a lateral
reference to outside that scope: failing to add an additional PHV
risks evaluating the expression at the wrong place and hence not
forcing it to null when the outer join should do so.  This is an
oversight in commit 9e7e29c75, which added logic to forcibly wrap
lateral-reference Vars in PlaceHolderVars, but didn't see that the
adjacent case for PlaceHolderVars needed the same treatment.

The test case we have for this doesn't fail before 4be058fe9, but now
that I see the problem I wonder if it is possible to demonstrate
related errors before that.  That's moot though, since all such
branches are out of support.

Per bug #18284 from Holger Reise.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18284-47505a20c23647f8@postgresql.org
2024-01-11 15:28:22 -05:00
..
access Remove hastup from LVPagePruneState. 2024-01-11 13:30:12 -05:00
archive Update copyright for 2024 2024-01-03 20:49:05 -05:00
backup Add new function pg_get_wal_summarizer_state(). 2024-01-11 12:41:18 -05:00
bootstrap Update copyright for 2024 2024-01-03 20:49:05 -05:00
catalog Track conflict_reason in pg_replication_slots. 2024-01-04 08:26:25 +05:30
commands ALTER TABLE command to change generation expression 2024-01-04 16:28:54 +01:00
executor Fix indentation in ExecParallelHashIncreaseNumBatches() 2024-01-08 20:00:20 +02:00
foreign Update copyright for 2024 2024-01-03 20:49:05 -05:00
jit Update copyright for 2024 2024-01-03 20:49:05 -05:00
lib Update copyright for 2024 2024-01-03 20:49:05 -05:00
libpq Update copyright for 2024 2024-01-03 20:49:05 -05:00
main Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodes Handle WindowClause.runCondition in tree walker/mutator functions. 2024-01-10 13:36:33 -05:00
optimizer Allow subquery pullup to wrap a PlaceHolderVar in another one. 2024-01-11 15:28:22 -05:00
parser ALTER TABLE command to change generation expression 2024-01-04 16:28:54 +01:00
partitioning Update copyright for 2024 2024-01-03 20:49:05 -05:00
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Update copyright for 2024 2024-01-03 20:49:05 -05:00
postmaster Reindent after commit d9ef650fca. 2024-01-11 13:24:35 -05:00
regex Update copyright for 2024 2024-01-03 20:49:05 -05:00
replication Make dblink interruptible, via new libpqsrv APIs. 2024-01-08 11:39:56 -08:00
rewrite Update copyright for 2024 2024-01-03 20:49:05 -05:00
snowball Add copyright notices to a few perl scripts that don't have them 2024-01-05 13:15:50 +00:00
statistics Update copyright for 2024 2024-01-03 20:49:05 -05:00
storage Cross-check lists of predefined LWLocks. 2024-01-09 11:05:19 -06:00
tcop Update copyright for 2024 2024-01-03 20:49:05 -05:00
tsearch Update copyright for 2024 2024-01-03 20:49:05 -05:00
utils Restore initdb's old behavior of always setting the lc_xxx GUCs. 2024-01-10 18:09:29 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Cross-check lists of predefined LWLocks. 2024-01-09 11:05:19 -06:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls.mk Remove distprep 2023-11-06 15:18:04 +01:00