lib/pq

Go PostgreSQL driver for database/sql

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 4 minutes ago
Added to GitGenius on September 6th, 2026
Created on March 12th, 2012
Open Issues & Pull Requests: 52 (+0)
GitHub issues: Enabled
Number of forks: 970
Total Stargazers: 9,957 (+0)
Total Subscribers: 148 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 28.1 hours
Mean response time: 431.6 days
90th percentile: 1901.8 days
Tracked items: 379

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 97% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "docs" is answered fastest, typically in under an hour, while "enhancement" waits about 24 months. Only 11% of issues opened in the past year have been closed. Three people close 96% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 34
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 2,307 days
Stale 30+ days: 30
Stale 90+ days: 26

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (42)
  • enhancement (25)
  • new-feature (22)
  • needs-feedback (19)
  • docs (10)
  • help-wanted (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

pq is a Go PostgreSQL driver for database/sql.

The driver solves the problem of connecting Go applications to PostgreSQL databases by implementing the standard database/sql interface. It supports connection strings compatible with PostgreSQL's libpq, accepting both key=value and postgres:// URL formats, and allows runtime parameters like search_path and work_mem to be specified directly in the connection string. PostgreSQL errors are returned as structured pq.Error types that can be inspected for error codes and supplemented with detail and context information when available.

Developers should choose pq if they are building Go applications that need to interact with PostgreSQL and prefer a driver that integrates with the standard library's database/sql package. The driver supports all maintained PostgreSQL versions and provides authentication methods including PASSWORD, MD5, and SCRAM-SHA256 out of the box, with optional GSS/Kerberos support available through a separate module to avoid unnecessary dependencies. The tool is well-suited for applications requiring bulk data import via COPY statements, listening for database notifications through pq.Listener, or handling PostgreSQL-specific features like NOTICE messages through registered callbacks.

The project maintains a stable codebase with infrequent but deliberate updates. Pull requests receive careful review with discussion of implementation details and edge cases before acceptance. Issues are addressed thoughtfully, with maintainers providing detailed explanations of design decisions and occasionally declining requests that would add unnecessary complexity. The project prioritizes backward compatibility and avoids breaking changes, reflecting a mature approach to API stability.