Re: aggregates with complex type as state and init condition

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: aggregates with complex type as state and init condition
Дата
Msg-id 11370.1093899286@sss.pgh.pa.us
обсуждение исходный текст
Ответ на aggregates with complex type as state and init condition  ("Thomas Chille" <thomas@chille.de>)
Список 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 по дате отправления:

Предыдущее
От: "David Parker"
Дата:
Сообщение: functionality like Oracle's "connect by"
Следующее
От: Tim Penhey
Дата:
Сообщение: Re: Single Row Table?