Mention that with PgBouncer get_backend_pid() is not updated

Close #956
This commit is contained in:
Daniele Varrazzo 2019-10-19 17:56:39 +01:00
parent 850c585501
commit 8a18ff7699
2 changed files with 6 additions and 4 deletions

View File

@ -117,7 +117,7 @@ The ``connection`` class
with a `~connection.commit()`/`~connection.rollback()` before with a `~connection.commit()`/`~connection.rollback()` before
closing. closing.
.. _PgBouncer: http://pgbouncer.projects.postgresql.org/ .. _PgBouncer: http://www.pgbouncer.org/
.. index:: .. index::
@ -822,8 +822,10 @@ The ``connection`` class
Also available as `~connection.info`\ `!.`\ Also available as `~connection.info`\ `!.`\
`~psycopg2.extensions.ConnectionInfo.backend_pid`. `~psycopg2.extensions.ConnectionInfo.backend_pid`.
Returns the process ID (PID) of the backend server process handling Returns the process ID (PID) of the backend server process *you
this connection. connected to*. Note that if you use a connection pool service such as
PgBouncer_ this value will not be updated if your connection is
switched to a different backend.
Note that the PID belongs to a process executing on the database Note that the PID belongs to a process executing on the database
server host, not the local host! server host, not the local host!

View File

@ -362,7 +362,7 @@ socket_get(connInfoObject *self)
static const char backend_pid_doc[] = static const char backend_pid_doc[] =
"The process ID (PID) of the backend process handling this connection.\n" "The process ID (PID) of the backend process you connected to.\n"
"\n" "\n"
":type: `!int`\n" ":type: `!int`\n"
"\n" "\n"