~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/pgsql.py

Merged db-devel into garbo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
399
399
                # always having this is a problem.
400
400
                try:
401
401
                    cur = con.cursor()
402
 
                    cur.execute('SELECT _killall_backends(%s)', [self.dbname])
 
402
                    cur.execute("""
 
403
                        SELECT pg_terminate_backend(procpid)
 
404
                        FROM pg_stat_activity
 
405
                        WHERE procpid <> pg_backend_pid() AND datname=%s
 
406
                        """, [self.dbname])
403
407
                except psycopg2.DatabaseError:
404
408
                    pass
405
409