Variables inside plpythonu

Поиск
Список
Период
Сортировка
От Frank Lanitz
Тема Variables inside plpythonu
Дата
Msg-id 20120512084355.fd007dd67b116ba3e0f885ff@frank.uvena.de
обсуждение исходный текст
Ответы Re: Variables inside plpythonu  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
Hi folks,

I did check the documentation but seem to didn't found the best way to
use plpythonu with a variable inside a query.
Let's say I want to run this query
SELECT id FROM some_table WHERE date=<date_from_function_call>
How a CREATE FUNCTION stateent have to look like?
I already figured out that the python code should look similar to

plan = plpy.prepare("SELECT id FROM some_table WHERE date=????
return = plpy.execure(plan)

But somehow a last piece is missing.

Can anybody help?

Cheers,
Frank
--
Frank Lanitz <frank@frank.uvena.de>

Вложения

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

Предыдущее
От: Alexander Farber
Дата:
Сообщение: Lock out PostgreSQL users for maintenance
Следующее
От: Frank Lanitz
Дата:
Сообщение: Re: Lock out PostgreSQL users for maintenance