Re: closing a connection from "outside" an application (for testing)
"Webb Sprague" <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Jan 5, 2008 9:47 AM, Eli Collins <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Webb Sprague wrote: > > > > Is there a way for psycopg to return the PID of the process it is > > connected to, primarily for logging (and killing)? I am still trying > > to figure out how to stop a run of my program in mid-stream (besides a > > sleep() or waiting on a signal...), but that will get me started. > There's this patch to psycopg, > > http://www.initd.org/tracker/psycopg/ticket/163 > > which exposes the backend pid as "conn.backend_pid"... > sadly, that would require compiling your own patched copy of psycopg :( For my purposes, the pg_current_backend() and a couple of signal handlers will work. I just need to see what happens. But thanks to everyone for their great help!