A pure Go driver and toolkit for PostgreSQL, offering high performance and PostgreSQL-specific features.
pgx is a PostgreSQL driver and toolkit written in Go, designed to provide a high-performance, low-level interface to PostgreSQL databases. It solves the need for efficient database interactions in Go applications by exposing PostgreSQL-specific features like `LISTEN`/`NOTIFY` and `COPY` while also supporting the standard `database/sql` interface.
Go developers building applications that rely on PostgreSQL, especially those needing optimized performance, PostgreSQL-specific functionality, or tools for implementing database proxies, load balancers, or logical replication clients.
Developers choose pgx for its superior performance over generic SQL drivers, direct access to PostgreSQL features, and its comprehensive toolkit that enables advanced database tooling beyond simple query execution.
PostgreSQL driver and toolkit for Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Direct support for PostgreSQL-specific features like LISTEN/NOTIFY and COPY protocol, enabling real-time notifications and efficient bulk data operations without workarounds.
Uses binary format for custom types and automatic statement caching, reducing latency and improving throughput compared to text-based drivers.
Supports approximately 70 PostgreSQL types with built-in mappings for complex types like hstore, jsonb, and inet/cidr, simplifying data handling.
Includes underlying packages for parsing the wire protocol and type mapping, allowing developers to build custom drivers, proxies, or replication clients.
Exclusively designed for PostgreSQL, making it unsuitable for applications that need database agnosticism or might migrate to other database systems.
The low-level interface and plethora of features can be overkill for straightforward CRUD applications, adding unnecessary learning and setup overhead.
For certain types or logging integrations, separate adapter libraries are required, which can complicate dependency management and increase maintenance effort.