pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gherzig@fmed.uba.ar
To: Michael Fuhr <mike@fuhr.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SOT] pypgsql function receiving dictionary as parameter?
Date: Fri, 19 Aug 2005 10:34:56 -0300 (ART)
Message-ID: <49662.157.92.152.53.1124458496.squirrel@webmail.fmed.uba.ar> (raw)
In-Reply-To: <20050819132207.GA83693@winnie.fuhr.org>
References: <44856.157.92.152.53.1124457200.squirrel@webmail.fmed.uba.ar>
	<20050819132207.GA83693@winnie.fuhr.org>

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
>
>





view thread (3+ messages)

Message-ID: <49662.157.92.152.53.1124458496.squirrel@webmail.fmed.uba.ar>
Permalink:  ../49662.157.92.152.53.1124458496.squirrel@webmail.fmed.uba.ar/
Also on:    postgresql.org/message-id/49662.157.92.152.53.1124458496.squirrel@webmail.fmed.uba.ar

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gherzig@fmed.uba.ar, mike@fuhr.org
  Subject: Re: [SOT] pypgsql function receiving dictionary as parameter?
  In-Reply-To: <49662.157.92.152.53.1124458496.squirrel@webmail.fmed.uba.ar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox