postgresql/src/include
Tom Lane aa8a2c3a61 Fix generation of MergeAppend plans for optimized min/max on expressions.
Before jamming a desired targetlist into a plan node, one really ought to
make sure the plan node can handle projections, and insert a buffering
Result plan node if not.  planagg.c forgot to do this, which is a hangover
from the days when it only dealt with IndexScan plan types.  MergeAppend
doesn't project though, not to mention that it gets unhappy if you remove
its possibly-resjunk sort columns.  The code accidentally failed to fail
for cases in which the min/max argument was a simple Var, because the new
targetlist would be equivalent to the original "flat" tlist anyway.
For any more complex case, it's been broken since 9.1 where we introduced
the ability to optimize min/max using MergeAppend, as reported by Raphael
Bauduin.  Fix by duplicating the logic from grouping_planner that decides
whether we need a Result node.

In 9.2 and 9.1, this requires back-porting the tlist_same_exprs() function
introduced in commit 4387cf956b, else we'd
uselessly add a Result node in cases that worked before.  It's rather
tempting to back-patch that whole commit so that we can avoid extra Result
nodes in mainline cases too; but I'll refrain, since that code hasn't
really seen all that much field testing yet.
2013-11-07 13:13:19 -05:00
..
access Avoid deadlocks during insertion into SP-GiST indexes. 2013-06-14 14:26:50 -04:00
bootstrap Fix management of pendingOpsTable in auxiliary processes. 2012-07-18 15:28:17 -04:00
catalog Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY. 2012-11-29 10:37:13 -05:00
commands Fix ALTER EXTENSION / SET SCHEMA 2012-10-31 10:48:41 -03:00
datatype Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
executor Fix plpgsql's reporting of plan-time errors in possibly-simple expressions. 2013-01-30 20:02:33 -05:00
foreign Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
lib Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
libpq Produce a more useful error message for over-length Unix socket paths. 2012-11-29 19:57:10 -05:00
mb Back-patch addition of pg_wchar-to-multibyte conversion functionality. 2012-07-10 16:52:36 -04:00
nodes Change post-rewriter representation of dropped columns in joinaliasvars. 2013-07-23 16:23:08 -04:00
optimizer Fix generation of MergeAppend plans for optimized min/max on expressions. 2013-11-07 13:13:19 -05:00
parser Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
port Unconditionally use the WSA equivalents of Socket error constants. 2013-08-26 14:56:49 -04:00
portability Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
postmaster Improve coding around the fsync request queue. 2012-07-17 16:57:10 -04:00
regex Fix crash on compiling a regular expression with more than 32k colors. 2013-04-04 19:31:59 +03:00
replication Fix typo in comment. 2013-05-23 11:35:00 -04:00
rewrite Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars. 2012-06-30 16:45:27 -04:00
snowball Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
storage Eliminate xmin from hash tag for predicate locks on heap tuples. 2013-10-07 14:15:24 -05:00
tcop Fix insecure parsing of server command-line switches. 2013-04-01 14:00:59 -04:00
tsearch Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
utils Fix include-guard 2013-07-07 13:38:47 +02:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
c.h Remove leftovers of BeOS port 2012-05-14 04:50:39 +03:00
fmgr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
funcapi.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
getaddrinfo.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
getopt_long.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
Makefile Fix server header file installation with vpath builds 2011-11-10 20:52:54 +02:00
miscadmin.h Make REPLICATION privilege checks test current user not authenticated user. 2013-04-01 13:09:29 -04:00
pg_config.h.in Make configure probe for mbstowcs_l as well as wcstombs_l. 2012-08-31 14:18:02 -04:00
pg_config.h.win32 Stamp 9.2.5. 2013-10-07 23:16:13 -04:00
pg_config_manual.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_trace.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pgstat.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pgtime.h Fix some odd behaviors when using a SQL-style simple GMT offset timezone. 2013-11-01 12:13:26 -04:00
port.h Use correct output device for Windows prompts. 2013-01-24 16:01:31 -05:00
postgres.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
postgres_ext.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres_fe.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
rusagestub.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
windowapi.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00