PQsocket.argtypes = [PGconn_ptr]
PQsocket.restype = c_int
+PQbackendPID = pq.PQbackendPID
+PQbackendPID.argtypes = [PGconn_ptr]
+PQbackendPID.restype = c_int
+
# 33.11. Miscellaneous Functions
def socket(self):
return impl.PQsocket(self.pgconn_ptr)
+ @property
+ def backend_pid(self):
+ return impl.PQbackendPID(self.pgconn_ptr)
+
def _encode(self, s):
if isinstance(s, bytes):
return s
def test_server_version(pgconn):
assert pgconn.server_version >= 90400
+
+
+def test_backend_pid(pgconn):
+ assert 2 <= pgconn.backend_pid <= 65535 # Unless increased in kernel?