Re: psycopg2 weirdness

2009-01-19 Thread Yang Zhang
For posterity: the problem turned out to be a second request being made in quick succession by the client-side Javascript, causing the web.py request handler to run in multiple threads concurrently. The request handlers don't create their own Postgresql connections, but instead share one acros

Re: psycopg2 weirdness

2009-01-17 Thread Philip Semanchuk
On Jan 17, 2009, at 12:48 PM, Neha Gupta wrote: Hey, I only have little experience with web.py and psycopg2 and am running into a weird problem, I'd appreciate any help I can get with debugging it. Hi Neha, There's a lot of pieces involved here and your subject implies you've isolated the

Re: psycopg2 weirdness

2009-01-17 Thread Tino Wildenhain
Neha Gupta wrote: Hey, ... crs_dep_hour, origin from flightdata where date = '" + date + "' group ^^^ never ever do that! Even more when input comes from user. The correct form is cur.exec("... date = %s group by ...",(date,)) ple

psycopg2 weirdness

2009-01-17 Thread Neha Gupta
Hey, I only have little experience with web.py and psycopg2 and am running into a weird problem, I'd appreciate any help I can get with debugging it. I wrote a simple program that works and I don't see any crash: import psycopg2 try: database_conn = psycopg2.connect("dbname='dbname'