mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
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.
This commit is contained in:
@@ -72,7 +72,8 @@ AggregateCreate(const char *aggName,
|
||||
Oid aggmTransType,
|
||||
int32 aggmTransSpace,
|
||||
const char *agginitval,
|
||||
const char *aggminitval)
|
||||
const char *aggminitval,
|
||||
char proparallel)
|
||||
{
|
||||
Relation aggdesc;
|
||||
HeapTuple tup;
|
||||
@@ -622,7 +623,7 @@ AggregateCreate(const char *aggName,
|
||||
false, /* isStrict (not needed for agg) */
|
||||
PROVOLATILE_IMMUTABLE, /* volatility (not
|
||||
* needed for agg) */
|
||||
PROPARALLEL_UNSAFE,
|
||||
proparallel,
|
||||
parameterTypes, /* paramTypes */
|
||||
allParameterTypes, /* allParamTypes */
|
||||
parameterModes, /* parameterModes */
|
||||
|
||||
Reference in New Issue
Block a user