Re: [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite)

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Marko Tiikkaja <pgmail(at)joh(dot)to>
Cc: Manlio Perillo <manlio(dot)perillo(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite)
Date: 2013-02-15 21:28:05
Message-ID: 511EA865.3010009@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/14/13 2:42 PM, Marko Tiikkaja wrote:
>> I think the reason this doesn't work is that in order to prepare a query
>> you need to know the parameter types, but you don't know that in Python,
>> or at least with the way the DB-API works. For example, if you write
>>
>> cur.execute("SELECT * FROM tbl WHERE a = %s AND b = %s", (val1, val2))
>>
>> what types will you pass to PQsendQueryParams?
>
> Pardon me if this is obvious, but why would you need to pass any types
> at all? Assuming we're still talking about PQsendQueryParams and not an
> explicit prepare/execute cycle..

Well, PQsendQueryParams() requires types to be passed, doesn't it?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Rolsky 2013-02-15 22:06:12 Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist
Previous Message Bruce Momjian 2013-02-15 20:32:05 Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist