Basic module usage — Psycopg 2.9.3 documentation
www.psycopg.org › docs › usageThread and process safety¶ The Psycopg module and the connection objects are thread-safe: many threads can access the same database either using separate sessions and creating a connection per thread or using the same connection and creating separate cursor s. In DB API 2.0 parlance, Psycopg is level 2 thread safe.
The connection class — Psycopg 2.9.3 documentation
www.psycopg.org › docs › connectionThe connection class¶ class connection¶ Handles the connection to a PostgreSQL database instance. It encapsulates a database session. Connections are created using the factory function connect(). Connections are thread safe and can be shared among many threads. See Thread and process safety for details. Connections can be used as context ...