On this page
Overview
pgx is a PostgreSQL driver and toolkit for Go. Alongside its native API it provides a database/sql adapter and pgxpool, exposing COPY, LISTEN/NOTIFY, statement preparation and caching, PostgreSQL type mapping, TLS, and other database-specific capabilities.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Use PostgreSQL-specific features directly through the native pgx API
The low-level interface exposes COPY, LISTEN/NOTIFY, batch queries, binary formats, and mappings for roughly 70 PostgreSQL types.
Sources: [2]
Choose pgxpool or the database/sql adapter according to application boundaries
pgxpool provides a concurrency-safe connection pool, while the stdlib adapter supports libraries built around database/sql. Applications can also move from a database/sql connection to the lower-level pgx interface when needed.
Sources: [2]
Best fit
Fits PostgreSQL-only backends that need driver-level features and control
It is well suited to APIs, batch jobs, and data services that target PostgreSQL and need explicit control over COPY, LISTEN/NOTIFY, type mapping, pooling, or protocol-level behavior.
Sources: [2]
Before adoption
v5.11.0 requires Go 1.25+; regression-test Rows, date/time decoding, and connection strings
The v5.11.0 go.mod declares Go 1.25. The release adds Go 1.27 RowsColumnScanner support, Rows.TypeMap, libpq connection-string compatibility changes, and a new PostgreSQL date/time parser, so mocks, custom types, date/time values, and connection strings need upgrade coverage.
Official sources
- [1]jackc/pgx — GitHub repository(2026-10-06)
- [2]pgx v5.11.0 — README(2026-10-06)
- [3]pgx v5.11.0 — go.mod(2026-10-06)
- [4]pgx v5.11.0 release(2026-10-06)
- [5]pgx MIT license(2026-10-06)
Supplemental curator note
For PostgreSQL-only applications, the native pgx API exposes database-specific capabilities directly, while a database/sql adapter remains available. Configure pooling, statement caching, and type mapping to match the application workload.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/jackc/pgx.git - 2
Enter the repository
cd pgx - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
14,300 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 50
- Open PRs
- 32
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- PostgreSQL22,283 Stars
4 shared tag(s) · 1 shared category(s)
combine SQL transactions, constraints, indexes, and extensible types/functions in an object-relational database engine
C - Diesel14,193 Stars
3 shared tag(s) · 2 shared category(s)
validate SQL queries and schemas with Rust's type system through an ORM and query builder
Rust - SQLAlchemy12,201 Stars
3 shared tag(s) · 2 shared category(s)
combine SQL expressions and ORM mapping in one Python data-access toolkit
Python - SeaORM9,914 Stars
3 shared tag(s) · 2 shared category(s)
manage asynchronous queries, relations, and migrations with a relational ORM for Rust
Rust - mysql22,273 Stars
3 shared tag(s) · 2 shared category(s)
connect Ruby to MySQL or MariaDB and handle SQL queries, prepared statements, and streaming results
Ruby - MySQL Server12,441 Stars
3 shared tag(s) · 1 shared category(s)
Run relational workloads with InnoDB transactions, SQL, replication, and high-availability tooling
C++
Report incorrect information
Tell us if any listing information is incorrect or outdated.