postgres/src
Tom Lane 41a2760f61 Fix collation assignment for aggregates with ORDER BY.
ORDER BY expressions were being treated the same as regular aggregate
arguments for purposes of collation determination, but really they should
not affect the aggregate's collation at all; only collations of the
aggregate's regular arguments should affect it.

In many cases this mistake would lead to incorrectly throwing a "collation
conflict" error; but in some cases the corrected code will silently assign
a different collation to the aggregate than before, for example
	agg(foo ORDER BY bar COLLATE "x")
which will now use foo's collation rather than "x" for the aggregate.
Given this risk and the lack of field complaints about the issue, it
doesn't seem prudent to back-patch.

In passing, rearrange code in assign_collations_walker so that we don't
need multiple copies of the standard logic for computing collation of a
node with children.  (Previously, CaseExpr duplicated the standard logic,
and we would have needed a third copy for Aggref without this change.)

Andrew Gierth and David Fetter
2013-04-26 15:48:53 -04:00
..
backend Fix collation assignment for aggregates with ORDER BY. 2013-04-26 15:48:53 -04:00
bin Ensure that user created rows in extension tables get dumped if the table is explicitly requested, either with a -t/--table switch of the table itself, or by -n/--schema switch of the schema containing the extension table. Patch reviewed by Vibhor Kumar and Dimitri Fontaine. 2013-04-26 12:02:40 -07:00
common Move relpath() to libpgcommon 2013-02-21 22:46:17 -03:00
include Clean up references to SQL92 2013-04-20 11:04:41 -04:00
interfaces libpq: Fix a few bits that didn't get the memo about COPY BOTH. 2013-04-26 08:59:40 -04:00
makefiles Blind attempt at fixing the non-MSVC Windows builds 2013-02-22 11:51:15 -03:00
pl Move pqsignal() to libpgport. 2013-03-17 12:06:42 -04:00
port initdb needs pqsignal() even on Windows. 2013-03-17 15:19:47 -04:00
template Remove _FORTIFY_SOURCE 2012-10-10 21:42:38 -04:00
test Fix collation assignment for aggregates with ORDER BY. 2013-04-26 15:48:53 -04:00
timezone Update time zone data files to tzdata release 2013b. 2013-03-28 15:25:48 -04:00
tools pgindent: add newline to die() so script line number is not reported on failure. 2013-04-16 10:30:35 -04:00
tutorial Modernize string literal syntax in tutorial example. 2013-01-19 17:20:32 -05:00
.gitignore
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Fix sporadic rebuilds for .pc files 2013-04-12 22:49:25 -04:00
Makefile.shlib Add pkg-config files for libpq and ecpg libraries 2013-03-31 16:58:40 -04:00
nls-global.mk NLS: Use msgmerge --previous option 2012-12-13 23:12:12 -05:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00