Skip site navigation (1) Skip section navigation (2)

BUG #3852: Could not create complex aggregate

From: "Sokolov Yura" <funny(dot)falcon(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3852: Could not create complex aggregate
Date: 2008-01-06 08:57:03
Message-ID: 200801060857.m068v38H045938@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
The following bug has been logged online:

Bug reference:      3852
Logged by:          Sokolov Yura
Email address:      funny(dot)falcon(at)gmail(dot)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

Responses

pgsql-hackers by date

Next:From: Joshua D. DrakeDate: 2008-01-06 09:50:12
Subject: Re: Bug: Unreferenced temp tables disables vacuum to update xid
Previous:From: Joshua D. DrakeDate: 2008-01-06 08:40:56
Subject: Bug: Unreferenced temp tables disables vacuum to update xid

pgsql-bugs by date

Next:From: Tom LaneDate: 2008-01-06 19:44:47
Subject: Re: BUG #3852: Could not create complex aggregate
Previous:From: Tom LaneDate: 2008-01-05 22:13:04
Subject: Re: pg_dump produces invalid SQL for "group by cast(null as numeric)"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group