Psycopg features
Psycopg is written mostly in C and wraps the libpq library with the result of being both fast and secure.
- Currently supports Python from 3.6 to 3.11 (older versions are supported by previous psycopg versions: check the change log for details)
- Supports PostgreSQL versions from 7.4 to 15
- Fully compliant implementation of the Python DB API specification for database adapters
- Thread-safe: threads can use different connections or share the same connection
- Asynchronous nonblocking I/O, also integrated with coroutine-based libraries (gevent, Eventlet, uGreen)
- Adaptation of many Python objects to database type: tuples to records, lists to array, dictionaries to hstore, flexible JSON support
- Extendible with new adapters to convert Python objects to SQL syntax and typecasters to convert PostgreSQL types back into Python objects
- Server-side cursors
- COPY support
- Large objects support
- Can send and receive asynchronous notification
- Support for two-phase commit