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

Re: Error in PostgreSQL query with psycopg

From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: Parthan <parth(dot)technofreak(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Error in PostgreSQL query with psycopg
Date: 2006-07-31 20:30:55
Message-ID: (view raw or whole thread)
Lists: pgsql-general

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:

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

or better

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

(that's with psycopg2)


GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstra├če 202b
70197 Stuttgart
Let's set so double the killer delete select all.

In response to


pgsql-general by date

Next:From: Martijn van OosterhoutDate: 2006-07-31 20:57:42
Subject: Re: Corrupted DB? could not open file pg_clog/####
Previous:From: Christian KastnerDate: 2006-07-31 20:18:31
Subject: Re: pg_xlog not cleaned up

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group