Re: trouble building user defined agg function with plpython

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: trouble building user defined agg function with plpython
Дата
Msg-id 9914.1308090610@sss.pgh.pa.us
обсуждение исходный текст
Ответ на trouble building user defined agg function with plpython  (Rick Harding <rharding@mitechie.com>)
Ответы Re: trouble building user defined agg function with plpython  (Rick Harding <rharding@mitechie.com>)
Список pgsql-general
Rick Harding <rharding@mitechie.com> writes:
> CREATE OR REPLACE FUNCTION mysum(curr integer, vals group_data)
>  RETURNS integer
>  AS $$
>     try:
>         curr = curr + vals['weight']
>     except UnboundLocalError:
>         plpy.notice("UNBOUND")
>         curr = 0
>     return curr
>  $$ LANGUAGE plpythonu;

This function doesn't work when called manually; it's got nothing to do
with the aggregate context.  You should read the last half of this page:

http://www.postgresql.org/docs/9.0/static/plpython-funcs.html

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "mike stanton"
Дата:
Сообщение: Re: system command in dblink?
Следующее
От: Stefan Keller
Дата:
Сообщение: Re: No implicit index created when adding primary key with ALTER TABLE