Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Error in PostgreSQL query with psycopg



Parthan,

never, never, never try quoting on your own! You can only fail. The only choice is to fail now or later.

The only recommended way with Python and DBAPI2.0 is:

lala="huibuh"
cs.execute ("select bla from foo where schupp=%s", (lala,))

or better

cs.execute ("select bla from foo where schupp=%(lala)s", dict(lala="huibuh"))

(that's with psycopg2)

Harald




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.

Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group