HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jackc
pgx
Go2016–2026
jackc / pgx

pgx

PostgreSQL driver and toolkit for Go

22Distinct people
22Mentions
0Explicit recommenders
14.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

PostgreSQL driver and toolkit for Go

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year22 dated mentions

Observed mentions: 2016-03-31 03:01:56 UTC to 2026-08-16 14:30:55 UTC.

02462016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC110
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC716
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC312
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC303

What Hacker News says

22 sources

Show HN: Pgdbtemplate – fast PostgreSQL test databases in Go using templates

Dear community, I have heard that appropriate self-promotion is allowed on this forum, so I want to welcome `pgdbtemplate`. It is the Go library for creating PostgreSQL test databases using template databases for lightning-fast test execution. Have you ever used PostgreSQL in your tests and been frustrated by how long it takes to spin up the database and run its migrations? `pgdbtemplate` offers... - Proven benchmarks showing 1.2x-1.6x faster performance than the traditional approach - Seamless integration with your projects by supporting both "github.com/lib/pq" and "github.com/jackc/pgx/v5" PostgreSQL drivers, as well as configurable connection pooling - Built-in migration handling - Full `testcontainers-go` support - Robust security implementation: safe against SQL injections, fully thread-safe operations - Production-ready
Read the rest
quality: SOLID principles enabling custom connectors and migration runners, >98% test coverage, and comprehensive documentation Ready to see how it works? Follow [this](https://github.com/andrei-polukhin/pgdbtemplate?tab=readme-o...) link and see the "Quick Start" example on how easily you can integrate `pdbtemplate` into your Go tests. I welcome feedback and questions about code abstractions, implementation details, security considerations, and documentation improvements. Thank you for reading this post. Let's explore how I can help you.
2 points · Open discussion
I'm also confused. 2. Agreed. 150 ms is extraordinarily slow for a point lookup from a single table. A simple lookup should take around 1 ms since it'll be cached in memory. 3. Also agreed. The actual database time looks to be the first flame. Hovering over it shows PG::Connection::exec which accounts for 2.5% of the time. I was curious about date parsing and dug up the source [1]. Seems like you could gain a ton of speed back by using a postgres specific timestamp parsing routine. In Go, it's 40 lines [2] [1] https://github.com/ruby/date/blob/d21c69450a57a1931ab6190385... [2]: https://github.com/jackc/pgx/blob/a968ce3437eefc4168b39bbc4b...
In It's not Ruby that's slow, it's your database
Awesome to hear more about MySQL/Vitess connection pooling. Folks typically only consider memory usage for database connections, but we've also had to consider the p99 latency for establishing a connection. For SpiceDB[0] one place we've struggled for our MySQL backend (originally contributed by GitHub who are big Vitess users) is preemptively establishing connections in the pool so that it's always full. PGX[1] has been fantastic for Postgres and CockroachDB, but I haven't found something with enough control for MySQL. PS: Lots of love to to all my friends at Planetscale! SpiceDB is also a big user of vtprotobuf[2] -- a great contribution to the Go gRPC ecosystem. [0]: https://github.com/authzed/spicedb [1]: https://github.com/jackc/pgx [2]: https://github.com/planetscale/vtprotobuf
In One Million Database Connections
> What kind of language recommends[0] with a straight face that you just duplicate your entire codebase into a v2/ subdirectory? Not Go at least. You misunderstood the post completely. Here is an example of how you are supposed to change the import path for subsequent major versions (that is, backwards incompatible versions): https://github.com/jackc/pgx/blob/3599f646293c1b0d381214ab26... A one-line change to your modfile and the import path is changed.
In Effective Go
Depends on how you do it. It's designed first and foremost to work with vendored dependencies in a monorepo, and the external repository support is newer. Bazel won't pull in transitive dependencies unless you ask it to in the WORKSPACE file, which means that you can use a private mirror for all your dependencies if you like, which is fairly easy in practice (I do it for personal projects). The experience will vary depending on your preferences and the languages you use. With Go + Bazel, my experience is that the Bazel version will have fewer dependencies than the equivalent "go mod" version, because "go mod" will pull in dependencies more coarsely and Bazel has more fine-grained control. Go mod will pull in dependencies for the entire repo that you depend on, but with Bazel, you only need dependencies for the individual subpackages. As a
Read the rest
specific example... suppose you use github.com/jackc/pgx. With "go mod" you end up with "github.com/sirupsen/logrus" in your transitive dependencies, but with Bazel you don't, unless you use the part of pgx that requires logrus. You can also end up with "half the internet" in your dependencies pretty easily, but I think these days that is just the price of including random libraries in your project. As far as I can tell, the approach to avoid depending on half the internet is to be very conservative about your dependencies, but that is true regardless of the system you use to manage them. Just to pick on the JavaScript ecosystem, if you start a new JavaScript project and pull in TypeScript, Rollup, and Terser, you'll end up with a very SMALL lock file because each of these libraries have a very small number of carefully chosen dependencies.
In Bazel For Open-Source C/C++ Libraries Distribution
Hi. I created this library: https://github.com/georgysavva/scany. It allows developers to scan complex data from a database into Go structs and other composite types with just one function call and don't bother with rows iteration. scany isn't limited to any specific database. It integrates with `database/sql`, so any database with database/sql driver is supported. It also works with https://github.com/jackc/pgx - specific library for PostgreSQL. Apart from the out of the box support, scany can be easily extended to work with almost any database library. The library is feature-rich, well documented and tested.
In Show HN: Go Library for scanning data from a database into structs and more

Showing the 15 most recent of 22 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.