Skip to content

BUG: [pg_aggregate] with parallel aggregation and internal types generates wrong functions #2351

Description

@ibotty

When creating an aggregate using the pg_aggregate macro with ParallelOption::Safe the deserial function has the wrong signature.

From: https://www.postgresql.org/docs/current/sql-createaggregate.html

deserialfunc
Deserialize a previously serialized aggregate state back into state_data_type. This function must take two arguments of types bytea and internal, and produce a result of type internal. (Note: the second, internal argument is unused, but is required for type safety reasons.)

Generated is a function with a first argument of Self::State/internal though.

See the (AI generated) reproduction at https://github.com/ibotty/pgrx-internal-parallel-aggregate-bug-repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions