Python PostgreSQL with psycopg2 module
https://zetcode.com/python/psycopg206.07.2020 · import psycopg2 The psycopg2 is a Python module which is used to work with the PostgreSQL database. con = None We initialize the con variable to None. In case we could not create a connection to the database (for example the disk is full), we would not have a connection variable defined. This would lead to an error in the finally clause.
psycopg2 · PyPI
https://pypi.org/project/psycopg211.11.2021 · Released: Dec 29, 2021 psycopg2 - Python-PostgreSQL Database Adapter Project description Psycopg is the most popular PostgreSQL database adapter for the Python programming language. Its main features are the complete implementation of the Python DB API 2.0 specification and the thread safety (several threads can share the same connection).