From 41ea0c23761ca108e2f08f6e3151e3cb1f9652a1 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 5 Apr 2016 16:06:15 -0400 Subject: Fix parallel-safety code for parallel aggregation. has_parallel_hazard() was ignoring the proparallel markings for aggregates, which is no good. Fix that. There was no way to mark an aggregate as actually being parallel-safe, either, so add a PARALLEL option to CREATE AGGREGATE. Patch by me, reviewed by David Rowley. --- doc/src/sgml/ref/create_aggregate.sgml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/src/sgml') diff --git a/doc/src/sgml/ref/create_aggregate.sgml b/doc/src/sgml/ref/create_aggregate.sgml index 7a6f8a97fda..3df330393de 100644 --- a/doc/src/sgml/ref/create_aggregate.sgml +++ b/doc/src/sgml/ref/create_aggregate.sgml @@ -40,6 +40,7 @@ CREATE AGGREGATE name ( [ minitial_condition ] [ , SORTOP = sort_operator ] + [ , PARALLEL = { SAFE | RESTRICTED | UNSAFE } ] ) CREATE AGGREGATE name ( [ [ argmode ] [ argname ] arg_data_type [ , ... ] ] @@ -55,6 +56,8 @@ CREATE AGGREGATE name ( [ [ serialtype ] [ , INITCOND = initial_condition ] [ , HYPOTHETICAL ] + [ , PARALLEL = { SAFE | RESTRICTED | UNSAFE } ] + ) or the old syntax @@ -684,6 +687,12 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1; Currently, ordered-set aggregates do not need to support moving-aggregate mode, since they cannot be used as window functions. + + + The meaning of PARALLEL SAFE, PARALLEL RESTRICTED, + and PARALLEL UNSAFE is the same as for + . + -- cgit v1.2.3