Re: aggregates with complex type as state and init condition - Mailing list pgsql-general

From Tom Lane
Subject Re: aggregates with complex type as state and init condition
Date
Msg-id 11370.1093899286@sss.pgh.pa.us
Whole thread Raw
In response to aggregates with complex type as state and init condition  ("Thomas Chille" <thomas@chille.de>)
List pgsql-general
"Thomas Chille" <thomas@chille.de> writes:
> Now i tried to set the init-state to wnumeric(0, 0), but it wont work. The INITCOND-paramter only
> accept string-literals like '0, 0', '(0.0,0.0)', but if i use the agrregate i get always this:
> 'ERROR:  Cannot accept a constant of type RECORD'.

This isn't going to work in existing releases, but FWIW it does work in 8.0.

Do you really need the weight and the value to be of different
datatypes?  You could make it work in current releases by using
a two-element array as the state type.

BTW, as far as I can see all those functions would be better defined
as IMMUTABLE than VOLATILE.

            regards, tom lane

pgsql-general by date:

Previous
From: "David Parker"
Date:
Subject: functionality like Oracle's "connect by"
Next
From: Tim Penhey
Date:
Subject: Re: Single Row Table?