Re: [SOT] pypgsql function receiving dictionary as parameter?

From: gherzig(at)fmed(dot)uba(dot)ar
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SOT] pypgsql function receiving dictionary as parameter?
Date: 2005-08-19 13:34:56
Message-ID: 49662.157.92.152.53.1124458496.squirrel@webmail.fmed.uba.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)fmed(dot)uba(dot)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
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-08-19 14:59:35 Re: PGSQL function for converting between arbitrary numeric bases?
Previous Message Michael Fuhr 2005-08-19 13:22:07 Re: [SOT] pypgsql function receiving dictionary as parameter?