From: Jelte Fennema Date: Mon, 31 Jul 2023 15:05:01 +0000 (+0200) Subject: fix: fix pq close wrappers Python implementation X-Git-Tag: pool-3.2.0~76^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d620a5faf22d6722a1a203cb6527a7a6397366b1;p=thirdparty%2Fpsycopg.git fix: fix pq close wrappers Python implementation Co-authored-by: Denis Laxalde --- diff --git a/psycopg/psycopg/pq/_pq_ctypes.py b/psycopg/psycopg/pq/_pq_ctypes.py index 53d9a9bc1..9d4dd1814 100644 --- a/psycopg/psycopg/pq/_pq_ctypes.py +++ b/psycopg/psycopg/pq/_pq_ctypes.py @@ -315,22 +315,22 @@ if libpq_version >= 170000: _PQclosePortal.restype = PGresult_ptr -def PQclosePrepared(pgconn: PGconn_struct) -> int: +def PQclosePrepared(pgconn: PGconn_struct, name: str) -> int: if not _PQclosePrepared: raise NotSupportedError( "PQclosePrepared requires libpq from PostgreSQL 17," f" {libpq_version} available instead" ) - return _PQclosePrepared(pgconn) + return _PQclosePrepared(pgconn, name) -def PQclosePortal(pgconn: PGconn_struct) -> int: +def PQclosePortal(pgconn: PGconn_struct, name: str) -> int: if not _PQclosePortal: raise NotSupportedError( "PQclosePortal requires libpq from PostgreSQL 17," f" {libpq_version} available instead" ) - return _PQclosePortal(pgconn) + return _PQclosePortal(pgconn, name) PQresultStatus = pq.PQresultStatus @@ -539,22 +539,22 @@ if libpq_version >= 170000: _PQsendClosePortal.restype = c_int -def PQsendClosePrepared(pgconn: PGconn_struct) -> int: +def PQsendClosePrepared(pgconn: PGconn_struct, name: str) -> int: if not _PQsendClosePrepared: raise NotSupportedError( "PQsendClosePrepared requires libpq from PostgreSQL 17," f" {libpq_version} available instead" ) - return _PQsendClosePrepared(pgconn) + return _PQsendClosePrepared(pgconn, name) -def PQsendClosePortal(pgconn: PGconn_struct) -> int: +def PQsendClosePortal(pgconn: PGconn_struct, name: str) -> int: if not _PQsendClosePortal: raise NotSupportedError( "PQsendClosePortal requires libpq from PostgreSQL 17," f" {libpq_version} available instead" ) - return _PQsendClosePortal(pgconn) + return _PQsendClosePortal(pgconn, name) PQgetResult = pq.PQgetResult