Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# Psycopg 3 – PostgreSQL database adapter for Python

Psycopg 3 is a newly designed PostgreSQL database adapter for the Python programming language.

Psycopg 3 presents a familiar interface for everyone who has used Psycopg 2 or any other DB-API 2.0 database adapter, but allows to use more modern PostgreSQL and Python features, such as:

- Asynchronous support

- COPY support from Python objects

- A redesigned connection pool

- Support for static typing

- Server-side parameters binding

- Prepared statements

- Statements pipeline

- Binary communication

- Direct access to the libpq functionalities

## Documentation

- Getting started with Psycopg 3
  - Installation
  - Basic module usage
  - Passing parameters to SQL queries
  - Adapting basic Python types
  - Adapting other PostgreSQL types
  - Transactions management
  - Using COPY TO and COPY FROM
  - Differences from `psycopg2`
- More advanced topics
  - Asynchronous operations
  - Static Typing
  - Row factories
  - Connection pools
  - Cursor types
  - Data adaptation configuration
  - Prepared statements
  - Pipeline mode support
- Psycopg 3 API
  - The `psycopg` module
  - Connection classes
  - Cursor classes
  - COPY-related objects
  - Other top-level objects
  - `sql` – SQL string composition
  - `rows` – row factory implementations
  - `errors` – Package exceptions
  - `psycopg_pool` – Connection pool implementations
  - `conninfo` – manipulate connection strings
  - `adapt` – Types adaptation
  - `types` – Types information and adapters
  - `abc` – Psycopg abstract classes
  - `pq` – libpq wrapper module
  - `crdb` – CockroachDB support
  - `_dns` – DNS resolution utilities

### Release notes

- `psycopg` release notes
- `psycopg_pool` release notes

### Indices and tables

- Index

- Module Index