]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore(capability): drop has_pgbouncer_prepared() 835/head
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 13 Jun 2024 21:09:20 +0000 (23:09 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 13 Jun 2024 21:09:20 +0000 (23:09 +0200)
Document to use the `has_send_closed_prepared()` capability instead,
which is a necessary condition for PgBouncer support, and doesn't give
the impression to be sufficient.

docs/advanced/prepare.rst
docs/api/objects.rst
psycopg/psycopg/_capabilities.py
tests/test_capabilities.py

index e376e8e053a0cd592323e2f4c3629613c4c90428..98582a4d0338c946543abe83bbeee042762e3f2d 100644 (file)
@@ -68,8 +68,8 @@ PgBouncer__ middleware, using the following caveats:
 - PgBouncer version must be version `1.22`__ or newer.
 - PgBouncer `max_prepared_statements`__ must be greater than 0.
 - The libpq version on the client must be from PostgreSQL 17 or newer
-  (you can check the `~Capabilities.has_pgbouncer_prepared` capability to
-  verify it).
+  (you can check the `~Capabilities.has_send_close_prepared()` capability to
+  verify that the libpq implements the features required by PgBouncer).
 
 .. __: https://www.pgbouncer.org/
 .. __: https://www.pgbouncer.org/2024/01/pgbouncer-1-22-0
index b79c5833d01ab5ec9a9767d513b9e04c57be2e4f..5f6e2902e73539536ce9a080b2b3f00baaa831e8 100644 (file)
@@ -159,7 +159,6 @@ Libpq capabilities information
 
     .. automethod:: has_stream_chunked
     .. automethod:: has_send_close_prepared
-    .. automethod:: has_pgbouncer_prepared
 
         .. seealso:: :ref:`pgbouncer`
 
index 3ab7fd41546989d8da18407c25eb16f2c2ba136a..d1f6bb3ebca825674c5b6ec1fd1d1237f1a1d7ca 100644 (file)
@@ -71,15 +71,6 @@ class Capabilities:
         """
         return self._has_feature("PGconn.send_close_prepared()", 170000, check=check)
 
-    def has_pgbouncer_prepared(self, check: bool = False) -> bool:
-        """Check if prepared statements in PgBouncer are supported.
-
-        The feature requires libpq 17.0 and greater.
-        """
-        return self._has_feature(
-            "PgBouncer prepared statements compatibility", 170000, check=check
-        )
-
     def _has_feature(self, feature: str, want_version: int, check: bool) -> bool:
         """
         Check is a version is supported.
index 17fb96560827f2b741025e993a6eb18c32734be3..6f7b55e43cf398f2fcb5843ada0445ece48a1470 100644 (file)
@@ -18,7 +18,6 @@ caps = [
     ("has_cancel_safe", "Connection.cancel_safe()", 17),
     ("has_stream_chunked", "Cursor.stream() with 'size' parameter greater than 1", 17),
     ("has_send_close_prepared", "PGconn.send_close_prepared()", 17),
-    ("has_pgbouncer_prepared", "PgBouncer prepared statements compatibility", 17),
 ]