postgresql/src/backend
Tom Lane 89db83922a Further adjustments to PlaceHolderVar removal.
A new test case from Andreas Seltenreich showed that we were still a bit
confused about removing PlaceHolderVars during join removal.  Specifically,
remove_rel_from_query would remove a PHV that was used only underneath
the removable join, even if the place where it's used was the join partner
relation and not the join clause being deleted.  This would lead to a
"too late to create a new PlaceHolderInfo" error later on.  We can defend
against that by checking ph_eval_at to see if the PHV could possibly be
getting used at some partner rel.

Also improve some nearby LATERAL-related logic.  I decided that the check
on ph_lateral needed to take precedence over the check on ph_needed, in
case there's a lateral reference underneath the join being considered.
(That may be impossible, but I'm not convinced of it, and it's easy enough
to defend against the case.)  Also, I realized that remove_rel_from_query's
logic for updating LateralJoinInfos is dead code, because we don't build
those at all until after join removal.

Back-patch to 9.3.  Previous versions didn't have the LATERAL issues, of
course, and they also didn't attempt to remove PlaceHolderInfos during join
removal.  (I'm starting to wonder if changing that was really such a great
idea.)
2015-08-07 14:13:50 -04:00
..
access Address points made in post-commit review of replication origins. 2015-08-07 15:09:05 +02:00
bootstrap pgindent run for 9.5 2015-05-23 21:35:49 -04:00
catalog Fix BRIN to use SnapshotAny during summarization 2015-08-05 16:20:50 -03:00
commands Fix a number of places that produced XX000 errors in the regression tests. 2015-08-02 23:49:19 -04:00
executor Share transition state between different aggregates when possible. 2015-08-04 17:53:10 +03:00
foreign Code review for foreign/custom join pushdown patch. 2015-05-10 14:36:36 -04:00
lib Rely on inline functions even if that causes warnings in older compilers. 2015-08-05 18:19:52 +02:00
libpq Fix incorrect order of lock file removal and failure to close() sockets. 2015-08-02 14:55:03 -04:00
main Revoke support for strxfrm() that write past the specified array length. 2015-07-08 20:44:21 -04:00
nodes Reconcile nodes/*funcs.c with recent work. 2015-08-05 20:44:27 -04:00
optimizer Further adjustments to PlaceHolderVar removal. 2015-08-07 14:13:50 -04:00
parser Share transition state between different aggregates when possible. 2015-08-04 17:53:10 +03:00
po Translation updates 2015-06-28 23:56:55 -04:00
port Rely on inline functions even if that causes warnings in older compilers. 2015-08-05 18:19:52 +02:00
postmaster Fix incorrect order of lock file removal and failure to close() sockets. 2015-08-02 14:55:03 -04:00
regex Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
replication Address points made in post-commit review of replication origins. 2015-08-07 15:09:05 +02:00
rewrite RLS: Keep deny policy when only restrictive exist 2015-08-03 15:32:49 -04:00
snowball Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
storage Fix attach-related race condition in shm_mq_send_bytes. 2015-08-07 10:04:07 -04:00
tcop Add ALTER OPERATOR command, for changing selectivity estimator functions. 2015-07-14 18:17:55 +03:00
tsearch pgindent run for 9.5 2015-05-23 21:35:49 -04:00
utils Don't include low level locking code from frontend code. 2015-08-07 15:10:56 +02:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile AIX: Link the postgres executable with -Wl,-brtllib. 2015-07-15 21:00:26 -04:00
nls.mk Translation updates 2015-02-01 23:23:40 -05:00