Compatibility with psycopg 3.0 (#2088)

By default `psycopg2` is preferred. The `psycopg>=3.0` will be used only if `psycopg2` is not available or its version is too old.
This commit is contained in:
Alexander Kukushkin
2021-11-19 14:32:54 +01:00
committed by GitHub
parent edfe2a84e9
commit fce889cd04
30 changed files with 231 additions and 138 deletions
+7 -1
View File
@@ -35,7 +35,7 @@ To install requirements on a Mac, run the following:
.. _psycopg2_install_options:
**Psycopg2**
**Psycopg**
Starting from `psycopg2-2.8 <http://initd.org/psycopg/articles/2019/04/04/psycopg-28-released/>`__ the binary version of psycopg2 will no longer be installed by default. Installing it from the source code requires C compiler and postgres+python dev packages.
Since in the python world it is not possible to specify dependency as ``psycopg2 OR psycopg2-binary`` you will have to decide how to install it.
@@ -62,6 +62,12 @@ There are a few options available:
pip install psycopg2>=2.5.4
4. Use psycopg 3.0 instead of psycopg2
::
pip install psycopg[binary]>=3.0.0
**General installation for pip**
Patroni can be installed with pip: