quoting - bug ?

Karsten Hilbert <[email protected]> Thu, 26 Jun 2003 21:44:53 +0200
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Dear all,

suppose I want to find occurrences of "test" in a column
"data" in a table "testtable". SQL would be:

select * from testtable where data='test';

Rewriting that for use with pyPgSQL:

query = "select * from testtable where data=%s;"
arg = "test"
curs.execute(query, arg)

Right ?

However, this will produce the query:

 select * from testtable where data='test;'

which is wrong.

Is this a bug or am I not using pyPgSQL properly (if so it
needs to be in the docs) ?

Thanks,
Karsten
PS: I do know how to rewrite the query so it works. I am just
wondering about the above behaviour.
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php