Re: Cannot create an aggregate function with variadic parameters and enabled for parallel execution

From: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Cannot create an aggregate function with variadic parameters and enabled for parallel execution
Date: 2018-05-15 14:06:28
Message-ID: e3a0451a-395b-59fb-1755-2752c4349c51@imap.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

An easier way to reproduce the problem:

create aggregate weird_concat (foo variadic "any") (
    sfunc = concat_ws,
    stype = text,
    combinefunc = textcat
);

Hope it helps.

Best regards,
  Alexey

On 14/05/18 00:44, Alexey Bashtanov wrote:
> When trying to improve my extension Argm to work with parallel queries
> I found that
> CREATE AGGREGATE wants serial/deserial/combine functions
> to have variadic any parameter if the aggregate function itself is
> variadic any.
> If I add the requested parameter, CREATE AGGREGATE still cannot find
> the function.
>
> Having an analog of [m]finalfunc_extra for serial/deserial/combine
> functions
> may be a good idea, but it's not yet there. So the attached patch
> makes postgres
> skip the check for the parallel support functions.
>
> I would appreciate if someone could have a look at the patch.
> The problem is probably actual for 9.6+, so back-patch would be nice
> if there's no objections.
>
> Should one be curious how to reproduce the problem, please clone
> https://github.com/bashtanov/argm/tree/parallel
> and try make && make install && make installcheck. This fails without
> the patch, but works with it.
> The error message is "function argmax_combine(internal, internal) must
> accept VARIADIC ANY to be used in this aggregate".
> (Just in case: this "parallel" branch is a WIP, please use "master"
> branch if you need something stable).
>
> Best regards,
>   Alexey

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message AYahorau 2018-05-15 15:36:07 pg_ctl -D PGDATA stop -m fast gets the following message 57P03 FATAL: the database system is shutting down
Previous Message Ralf Jung 2018-05-15 09:11:30 Re: "REVOKE ... ON DATABASE template1 ..." has no effect