psycopg
https://pypi.org/project/psycopg/
#PostgreSQL
Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python.
psycopgはPython実装らしい(pure Python)。それに対して、psycopg2はC実装
両方開発されている(2023/10) -> psycopg 3のみへ
https://www.psycopg.org/psycopg3/docs/
Installation https://www.psycopg.org/psycopg3/docs/basic/install.html
pip install "psycopg[binary]"
without [c] or [binary] extras you will obtain a pure Python implementation.
binaryであれば環境にlibpqは不要
Psycopg 3.0 released https://www.psycopg.org/articles/2021/10/13/psycopg-30-released/
Psycopg 3 is a complete rewrite based on the experience accumulated with the development and maintenance of psycopg2.
Djangoは4.2でPsycopg 3を採用した
https://docs.djangoproject.com/en/5.2/releases/4.2/#psycopg-3-support
Requires psycopg2 >= 2.8.4 or psycopg >= 3.1.8