Variables inside plpythonu - Mailing list pgsql-general

From Frank Lanitz
Subject Variables inside plpythonu
Date
Msg-id 20120512084355.fd007dd67b116ba3e0f885ff@frank.uvena.de
Whole thread Raw
Responses Re: Variables inside plpythonu
List 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>

Attachment

pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Lock out PostgreSQL users for maintenance
Next
From: Frank Lanitz
Date:
Subject: Re: Lock out PostgreSQL users for maintenance