Re: Where are plpy.execute python commands issued?

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема Re: Where are plpy.execute python commands issued?
Дата
Msg-id 4DDA5F1D.7020904@compulab.co.il
обсуждение исходный текст
Ответ на Where are plpy.execute python commands issued?  (Michael McInnis <mmcinnis59@msn.com>)
Список pgsql-general

On 05/23/2011 06:44 AM, Michael McInnis wrote:

I've seen numerous references to this syntax but haven't found where you issue the command.

Tried it in a testpython.py file, no luck.
Can't find a plpy file anywhere.

I know it's going to be simple but need help.
pre.cjk { font-family: "DejaVu Sans",monospace; }p { margin-bottom: 0.08in; }
rv = plpy.execute("SELECT * FROM my_table", 5)
Thanks

Michael McInnis 6033 44th Ave. N.E. Seattle, WA 98115 206 517-4701

You have to run it as a plpythonu function as in:

create function test() returns int as
$$
rv=plpy.execute("SELECT * FROM my_table", 5)
for row in rv:
    do something
return 1
$$ langauge 'plpythonu';


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

Предыдущее
От: Leif Jensen
Дата:
Сообщение: Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: disable seqscan