Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. pgx

pgx

MITGo

A pure Go driver and toolkit for PostgreSQL, offering high performance and PostgreSQL-specific features.

Visit WebsiteGitHubGitHub
14.1k stars1.1k forks0 contributors

What is pgx?

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.

Target Audience

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.

Value Proposition

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.

Overview

PostgreSQL driver and toolkit for Go

Use Cases

Best For

  • Building high-performance Go applications that exclusively use PostgreSQL
  • Implementing PostgreSQL logical replication clients or proxies
  • Utilizing PostgreSQL-specific features like LISTEN/NOTIFY or COPY for bulk data
  • Developing custom database drivers or load balancers for PostgreSQL
  • Applications requiring binary format support for faster data encoding/decoding
  • Projects that need a connection pool with custom setup hooks

Not Ideal For

  • Applications requiring multi-database support or easy switching between different SQL databases
  • Teams relying on full-featured ORMs that abstract away direct SQL and database-specific details
  • Projects where developers prioritize simplicity and minimal setup over performance optimizations

Pros & Cons

Pros

Native PostgreSQL Features

Direct support for PostgreSQL-specific features like LISTEN/NOTIFY and COPY protocol, enabling real-time notifications and efficient bulk data operations without workarounds.

High Performance Design

Uses binary format for custom types and automatic statement caching, reducing latency and improving throughput compared to text-based drivers.

Comprehensive Type Support

Supports approximately 70 PostgreSQL types with built-in mappings for complex types like hstore, jsonb, and inet/cidr, simplifying data handling.

Advanced Tooling Foundation

Includes underlying packages for parsing the wire protocol and type mapping, allowing developers to build custom drivers, proxies, or replication clients.

Cons

PostgreSQL Lock-in

Exclusively designed for PostgreSQL, making it unsuitable for applications that need database agnosticism or might migrate to other database systems.

Complexity for Simple Use Cases

The low-level interface and plethora of features can be overkill for straightforward CRUD applications, adding unnecessary learning and setup overhead.

Dependency on Third-Party Adapters

For certain types or logging integrations, separate adapter libraries are required, which can complicate dependency management and increase maintenance effort.

Frequently Asked Questions

Quick Stats

Stars14,060
Forks1,083
Contributors0
Open Issues222
Last commit6 days ago
CreatedSince 2013

Tags

#database-driver#high-performance#connection-pooling#postgresql#wire-protocol#go#type-mapping#sql-toolkit

Built With

G
Go

Links & Resources

Website

Included in

Go169.1k
Auto-fetched 18 hours ago

Related Projects

go-sql-drivergo-sql-driver

Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package

Stars15,276
Forks2,329
Last commit1 day ago
pqpq

Go PostgreSQL driver for database/sql

Stars9,913
Forks970
Last commit13 days ago
go-sqlite3go-sqlite3

sqlite3 driver for go using database/sql

Stars9,184
Forks1,174
Last commit11 days ago
go-mssqldbgo-mssqldb

Microsoft SQL server driver written in go language

Stars1,883
Forks523
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub