mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Allow aggregate transition states to be serialized and deserialized.
This is necessary infrastructure for supporting parallel aggregation for aggregates whose transition type is "internal". Such values can't be passed between cooperating processes, because they are just pointers. David Rowley, reviewed by Tomas Vondra and by me.
This commit is contained in:
@@ -464,11 +464,15 @@ aggregates_allow_partial_walker(Node *node, partial_agg_context *context)
|
||||
}
|
||||
|
||||
/*
|
||||
* If we find any aggs with an internal transtype then we must ensure
|
||||
* that pointers to aggregate states are not passed to other processes;
|
||||
* therefore, we set the maximum allowed type to PAT_INTERNAL_ONLY.
|
||||
* If we find any aggs with an internal transtype then we must check
|
||||
* that these have a serialization type, serialization func and
|
||||
* deserialization func; otherwise, we set the maximum allowed type to
|
||||
* PAT_INTERNAL_ONLY.
|
||||
*/
|
||||
if (aggform->aggtranstype == INTERNALOID)
|
||||
if (aggform->aggtranstype == INTERNALOID &&
|
||||
(!OidIsValid(aggform->aggserialtype) ||
|
||||
!OidIsValid(aggform->aggserialfn) ||
|
||||
!OidIsValid(aggform->aggdeserialfn)))
|
||||
context->allowedtype = PAT_INTERNAL_ONLY;
|
||||
|
||||
ReleaseSysCache(aggTuple);
|
||||
|
||||
Reference in New Issue
Block a user