BUG #3852: Could not create complex aggregate - Mailing list pgsql-bugs

From Sokolov Yura
Subject BUG #3852: Could not create complex aggregate
Date
Msg-id 200801060857.m068v38H045938@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #3852: Could not create complex aggregate
List pgsql-bugs
The following bug has been logged online:

Bug reference:      3852
Logged by:          Sokolov Yura
Email address:      funny.falcon@gmail.com
PostgreSQL version: 8.3beta4
Operating system:   Linux Debian 4.0rel2
Description:        Could not create complex aggregate
Details:

Possibly it's not an error, then how can I make such aggregate?

create or replace function add_group(grp anyarray, ad anyelement, size int4)
returns anyarray
language plpgsql
as $$
begin
  if array_upper(grp, 1) < size then
    return grp||ad;
  end if;
  return grp;
end;
$$ immutable;

create aggregate build_group(anyelement, int4) (
  SFUNC= add_group,
  STYPE = anyarray
);

> ERROR:  argument declared "anyarray" is not an array but type anyarray
> SQL State:42804

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump produces invalid SQL for "group by cast(null as numeric)"
Next
From: Tom Lane
Date:
Subject: Re: BUG #3852: Could not create complex aggregate