Re: [SOT] pypgsql function receiving dictionary as parameter? - Mailing list pgsql-sql

From gherzig@fmed.uba.ar
Subject Re: [SOT] pypgsql function receiving dictionary as parameter?
Date
Msg-id 49662.157.92.152.53.1124458496.squirrel@webmail.fmed.uba.ar
Whole thread Raw
In response to Re: [SOT] pypgsql function receiving dictionary as parameter?  (Michael Fuhr <mike@fuhr.org>)
List pgsql-sql
Suppose this python structure:

someDict = {           'field1': 'Foo',           'creepyfield': 'Bar'           }

and the connection to the database
CONN = pg.connect()....

I want some pypgslq function

CREATE myfunction ( __dictionary__) returns void
AS
.... (process)
LANGUAGE pythonu

and (the desired goal) be able to execute
CONN.execute("select * from myfunction (someDict)")

Thanks again, and yes, i might post to the others postgres list too.

-- 
Gerardo Herzig
Direccion General de Organizacion y Sistemas
Facultad de Medicina
U.B.A.
> On Fri, Aug 19, 2005 at 10:13:20AM -0300, gherzig@fmed.uba.ar wrote:
>> Hi all. Im a python programer, and im trying to use a dictionary
>> (associative array on Perl) in my pypgsql function without result.
>> Anybody
>> know if it is possible?
>
> Please show a minimal but complete example of what you're trying to do.
>
> BTW, pgsql-sql is supposed to be for SQL-related matters; this thread
> would be more appropriate in pgsql-general or pgsql-interfaces.
>
> --
> Michael Fuhr
>
>




pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: [SOT] pypgsql function receiving dictionary as parameter?
Next
From: Bruno Wolff III
Date:
Subject: Re: PGSQL function for converting between arbitrary numeric bases?