Variables inside plpythonu

From: Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Variables inside plpythonu
Date: 2012-05-12 06:43:55
Message-ID: 20120512084355.fd007dd67b116ba3e0f885ff@frank.uvena.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)frank(dot)uvena(dot)de>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Lanitz 2012-05-12 06:50:55 Re: Lock out PostgreSQL users for maintenance
Previous Message Alexander Farber 2012-05-12 04:29:54 Lock out PostgreSQL users for maintenance