How to 'register' functions, so they can be called (plpythonu)

Поиск
Список
Период
Сортировка
От blay bloo
Тема How to 'register' functions, so they can be called (plpythonu)
Дата
Msg-id 66c468170709041153n55c1f215o5483448e201859b3@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to 'register' functions, so they can be called (plpythonu)  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: How to 'register' functions, so they can be called (plpythonu)  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
I am defining some functions using plpythonu, through the standard means.

Here I have one function (test1) which calls another (testfunc). When
I excute this I get the following error:

ERROR:  plpython: function "test1" failed
DETAIL:  <type 'exceptions.NameError'>: global name 'testfunc' is not defined

However, from the console, select testfunc('test') works fine.

I was wondering how do I 'register'/'reference' these functions so
that one function can call another? I am guessing this is important,
i.e. how will I access the complete functionality of the general
python libs?

Cheers, Blay.

PS functions are defined in the usual way - e.g.

create or replace function test1(text) returns integer as $$
return 1
$$ language plpythonu;

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Connecting to PostgreSQL server with Mono using ident authetication
Следующее
От: "Martin Langhoff"
Дата:
Сообщение: Controlling locale and impact on LIKE statements