postgresql/src/include/utils
Tom Lane 8d65da1f01 Support ordered-set (WITHIN GROUP) aggregates.
This patch introduces generic support for ordered-set and hypothetical-set
aggregate functions, as well as implementations of the instances defined in
SQL:2008 (percentile_cont(), percentile_disc(), rank(), dense_rank(),
percent_rank(), cume_dist()).  We also added mode() though it is not in the
spec, as well as versions of percentile_cont() and percentile_disc() that
can compute multiple percentile values in one pass over the data.

Unlike the original submission, this patch puts full control of the sorting
process in the hands of the aggregate's support functions.  To allow the
support functions to find out how they're supposed to sort, a new API
function AggGetAggref() is added to nodeAgg.c.  This allows retrieval of
the aggregate call's Aggref node, which may have other uses beyond the
immediate need.  There is also support for ordered-set aggregates to
install cleanup callback functions, so that they can be sure that
infrastructure such as tuplesort objects gets cleaned up.

In passing, make some fixes in the recently-added support for variadic
aggregates, and make some editorial adjustments in the recent FILTER
additions for aggregates.  Also, simplify use of IsBinaryCoercible() by
allowing it to succeed whenever the target type is ANY or ANYELEMENT.
It was inconsistent that it dealt with other polymorphic target types
but not these.

Atri Sharma and Andrew Gierth; reviewed by Pavel Stehule and Vik Fearing,
and rather heavily editorialized upon by Tom Lane
2013-12-23 16:11:35 -05:00
..
.gitignore
acl.h
array.h
ascii.h
attoptcache.h
builtins.h Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
bytea.h
cash.h
catcache.h Make catalog cache hash tables resizeable. 2013-09-05 20:20:03 +03:00
combocid.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
date.h Add make_date() and make_time() functions. 2013-11-17 15:06:50 -05:00
datetime.h Add make_date() and make_time() functions. 2013-11-17 15:06:50 -05:00
datum.h
dynahash.h
dynamic_loader.h
elog.h Emit a log message if output is about to be redirected away from stderr. 2013-08-13 15:24:52 -04:00
evtcache.h
fmgrtab.h
formatting.h
geo_decls.h Revive line type 2013-10-09 22:34:38 -04:00
guc_tables.h
guc.h Add ALTER SYSTEM command to edit the server configuration file. 2013-12-18 23:42:44 +09:00
help_config.h
hsearch.h
inet.h
int8.h
inval.h Remove leftover function prototype. 2013-09-11 01:32:24 +09:00
json.h json_typeof function. 2013-10-10 12:21:59 -04:00
jsonapi.h
logtape.h
lsyscache.h Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
memdebug.h
memutils.h
nabstime.h
numeric.h
palloc.h Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
pg_crc_tables.h
pg_crc.h
pg_locale.h
pg_lzcompress.h
pg_rusage.h
plancache.h
portal.h
ps_status.h
rangetypes.h
rbtree.h
rel.h Add a new reloption, user_catalog_table. 2013-12-10 19:17:34 -05:00
relcache.h Add new wal_level, logical, sufficient for logical decoding. 2013-12-10 19:01:40 -05:00
relfilenodemap.h
relmapper.h
reltrigger.h
resowner_private.h Allow dynamic allocation of shared memory segments. 2013-10-09 21:05:02 -04:00
resowner.h
selfuncs.h
snapmgr.h
snapshot.h
sortsupport.h
spccache.h
syscache.h
timeout.h Fix assorted race conditions in the new timeout infrastructure. 2013-11-29 16:41:00 -05:00
timestamp.h
tqual.h Remove SnapshotNow and HeapTupleSatisfiesNow. 2013-08-01 10:46:19 -04:00
tuplesort.h Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
tuplestore.h
typcache.h
tzparser.h
uuid.h
varbit.h
xml.h