postgresql/src/include
Tom Lane 811a2cbc16 Fix planner's handling of outer PlaceHolderVars within subqueries.
For some reason, in the original coding of the PlaceHolderVar mechanism
I had supposed that PlaceHolderVars couldn't propagate into subqueries.
That is of course entirely possible.  When it happens, we need to treat
an outer-level PlaceHolderVar much like an outer Var or Aggref, that is
SS_replace_correlation_vars() needs to replace the PlaceHolderVar with
a Param, and then when building the finished SubPlan we have to provide
the PlaceHolderVar expression as an actual parameter for the SubPlan.
The handling of the contained expression is a bit delicate but it can be
treated exactly like an Aggref's expression.

In addition to the missing logic in subselect.c, prepjointree.c was failing
to search subqueries for PlaceHolderVars that need their relids adjusted
during subquery pullup.  It looks like everyplace else that touches
PlaceHolderVars got it right, though.

Per report from Mark Murawski.  In 9.1 and HEAD, queries affected by this
oversight would fail with "ERROR: Upper-level PlaceHolderVar found where
not expected".  But in 9.0 and 8.4, you'd silently get possibly-wrong
answers, since the value transmitted into the subquery wouldn't go to null
when it should.
2012-03-24 16:21:48 -04:00
..
access Fix timing of Startup CLOG and MultiXact during Hot Standby 2011-11-02 08:06:54 +00:00
bootstrap Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
catalog Fix some issues with temp/transient tables in extension scripts. 2012-03-08 15:52:34 -05:00
commands REASSIGN OWNED: Support foreign data wrappers and servers 2012-02-22 17:32:42 -03:00
executor Install defenses against overflow in BuildTupleHashTable(). 2011-05-23 12:52:46 -04:00
foreign pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
lib Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
libpq Remove arbitrary limitation on length of common name in SSL certificates. 2012-02-23 15:48:09 -05:00
mb Fix char2wchar/wchar2char to support collations properly. 2011-04-23 12:35:41 -04:00
nodes Fix planner's handling of outer PlaceHolderVars within subqueries. 2012-03-24 16:21:48 -04:00
optimizer Revisit handling of UNION ALL subqueries with non-Var output columns. 2012-03-16 13:11:20 -04:00
parser Fix handling of collations in multi-row VALUES constructs. 2011-04-18 15:31:52 -04:00
port Revert "Force use of "%I64d" format for 64 bit ints on MinGW." 2011-04-27 14:55:18 -04:00
portability Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
postmaster Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
regex Teach regular expression operators to honor collations. 2011-04-10 18:03:09 -04:00
replication Back-patch assorted latch-related fixes. 2011-08-10 12:20:45 -04:00
rewrite pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Resolve timing issue with logging locks for Hot Standby. 2012-02-01 09:31:07 +00:00
tcop Revise the API for GUC variable assign hooks. 2011-04-07 00:12:02 -04:00
tsearch pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
utils Run a portal's cleanup hook immediately when pushing it to FAILED state. 2012-02-15 16:18:39 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
c.h Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
fmgr.h Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
funcapi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
getaddrinfo.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
getopt_long.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
Makefile Fix server header file installation with vpath builds 2011-11-10 20:54:50 +02:00
miscadmin.h Add postmaster/postgres undocumented -b option for binary upgrades. 2011-04-25 12:00:21 -04:00
pg_config.h.in Allow MinGW builds to use standardly-named OpenSSL libraries. 2012-02-23 15:05:17 -05:00
pg_config.h.win32 Stamp 9.1.3. 2012-02-23 17:53:36 -05:00
pg_config_manual.h Revert accidental change to pg_config_manual.h. 2011-10-09 22:23:30 -04:00
pg_trace.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pgstat.h Fix VACUUM so that it always updates pg_class.reltuples/relpages. 2011-05-30 17:06:52 -04:00
pgtime.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
port.h setlocale() on Windows doesn't work correctly if the locale name contains 2011-09-01 11:10:23 +03:00
postgres.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
postgres_ext.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres_fe.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
rusagestub.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
windowapi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00