mrkeyoor.com_
Fri 30 Oct 06:45 UTC
Dataevaluationupdated 30 Oct 2026

pgx review

pgx is a Go driver and toolkit for PostgreSQL. It exposes PostgreSQL features such as COPY and LISTEN/NOTIFY through a native interface and includes an adapter for Go's standard database/sql interface.

Verdict

Evaluate pgx's native interface for PostgreSQL-only applications whose libraries do not require database/sql; consider the stdlib adapter when they do. Our run at commit 65a4125 installed in 12 seconds and built in 35 seconds, but tests failed after 40 seconds for an unresolved reason. Adoption also needs a revision-specific review of the unverified require_auth and malformed-URI password-redaction reports, whose proposed fixes remained open and unmerged in the supplied snapshot. Verify connectivity, representative queries and connection release before relying on the selected interface.

We ran it

Lab card: what happened when we ran pgxScreenshot of pgx (pkg.go.dev/github.com/jackc/pgx/v5)
Install✓ · 12s20 packages
Build✓ · 35s
Tests✗ · 40s0 passed · 2 failed of 2 (go test)
Repo405 files~89,633 lines of source · 2.8 MB · 1 CI workflows

Answers from our run

Does pgx build from source?

Dependencies installed in 12 seconds (20 packages), and the build succeeded in 35 seconds. We cloned commit 65a4125 into a clean Debian container with 3 CPUs and no project-specific setup.

Do pgx's tests pass?

No. The project's own test command finished in 40 seconds and reported 0 passed, 2 failed (go test).

Who should not use pgx?

Applications that need a driver targeting multiple database engines: pgx targets PostgreSQL.

What are the alternatives to pgx?

pq, sqlx. Evaluate pgx's native interface for PostgreSQL-only applications whose libraries do not require database/sql; consider the stdlib adapter when they do.

SetupN/AInstallation and compilation passed, but the actual toolchain and successful database connectivity were not established.
Docs4/5Rubric: 1 means absent guidance; 3 means a basic documented path; 4 adds explicit interface, connectivity and resource-release guidance; 5 requires reproduced integration evidence. The supplied README and pool reference support 4, while database integration remains unverified.
CommunityN/AThe supplied open reports and proposed fixes do not establish support responsiveness, adoption quality or resolution.
MaturityN/AThe unresolved test failure and unverified revision-specific reports do not establish production reliability or defect scope.

Who it’s for

Go developers building applications specifically for PostgreSQL.
Teams that need COPY or LISTEN/NOTIFY through a native driver interface.
Maintainers evaluating pgx through its stdlib adapter while retaining database/sql.

Who it’s NOT for

Applications that need a driver targeting multiple database engines: pgx targets PostgreSQL.
Teams that need officially documented support for Go versions below 1.25: the supplied README documents support for Go 1.25 and higher.
Teams that need this review to establish successful database integration or resolution of the reported authentication and password-redaction problems: neither was verified here.

Setup reality

Our run installed pgx at commit 65a4125 in 12 seconds with 20 dependencies recorded, then built it in 35 seconds. Tests exited 1 after 40 seconds. The recorded summary says 0 passed and 2 failed out of 2, but the tail names several failing cases under tracelog. That summary is not a reliable count of individual test cases.

The October 29, 2026 sandbox configuration listed 3 CPUs, 8g RAM and image golang:1.24-bookworm. The image label does not establish the actual compiler or operating-system version. The supplied README documents support for Go 1.25 and higher and PostgreSQL 14 and higher; it does not establish an enforced compiler minimum for the tested checkout.

Connection configuration accepts PostgreSQL URLs or key=value strings. Pool creation returns before a connection is established, so an adoption trial needs a separate connectivity check and representative database queries. Those checks have no measured result here.

Choose the interface around your application's dependencies

pgx gives PostgreSQL applications a native Go interface and a database/sql adapter. The README recommends the native interface when the application targets only PostgreSQL and no other libraries require database/sql. That makes existing library dependencies part of the decision, alongside the PostgreSQL operations the application needs.

The native interface exposes features such as COPY and LISTEN/NOTIFY. An existing database/sql application can instead evaluate pgx through its stdlib adapter while retaining that interface. Our run supplies no query-speed, connection-overhead or memory comparison, so it cannot establish a performance reason to migrate.

What happened when we ran it

Our run installed pgx in 12 seconds and built it in 35 seconds, with 20 dependencies recorded. The checkout was commit 65a4125, cloned on October 29, 2026. Its recorded sandbox configuration listed 3 CPUs, 8g RAM and image golang:1.24-bookworm. The label does not establish the actual compiler or operating-system version.

The test step exited 1 after 40 seconds. The recorded summary says 0 passed and 2 failed out of 2. The tail names several failures, including TestLogQuery, TestLoggerFunc, TestLogConnect, TestLogCopyFrom, TestConcurrentUsage and TestContextGetsPassedToLogMethod, and ends with a failure for github.com/jackc/pgx/v5/tracelog. The summary therefore cannot be treated as an exhaustive count of individual cases.

The supplied tail contains no assertions or connection errors that explain those failures. It does not establish a missing database, incorrect credentials or a toolchain mismatch. Installation and compilation succeeded; the test command failed for an unresolved reason. No successful representative application query is established by this run.

The checkout contained 405 files, roughly 89,633 source lines and 2.8 MB. The scan found one CI workflow file and detected no Dockerfile or tests directory. The named failures show why the absence of a tests directory must not be read as an absence of tests.

Check connectivity and connection release

The supplied pgxpool reference returns a pool before connections are established. It directs callers to acquire a connection immediately after pool creation to check connectivity. Successfully constructing the pool alone does not verify access to the intended database.

The README says connection settings can use PostgreSQL URLs or key=value strings. For an adoption trial, supply the service's connection settings, verify connectivity and run a representative query against the application's schema. These are proposed checks, not results from our run.

The pool reference also documents resource release. Close the rows returned by Pool.Query to return its acquired connection. Pool.QueryRow defers errors until Scan, and Scan returns the acquired connection to the pool. Review both error handling and connection release when changing query call sites.

Separate documented support from the tested environment

The supplied README documents support for Go 1.25 and higher and PostgreSQL 14 and higher. This is a support policy, not evidence of an enforced compiler minimum at commit 65a4125. The sandbox image name contains 1.24, but the actual toolchain logs and version-matched compiler requirements are absent. That difference warrants checking the selected checkout's toolchain before another run; it does not explain this failure.

The supplied pool reference links to source at v5.11.0. Its API guidance and the current README are documentation evidence, while our measurements belong to commit 65a4125. This review does not claim that the measured checkout was the v5.11.0 release.

Open reports matter to the adoption decision

The supplied October 30, 2026 issue snapshot includes an authentication report that needs attention before adoption. In issue #2698, the author reports that require_auth is not enforced when a server skips authentication and sends ReadyForQuery. The author identifies v5.11.0 and master 65a41258 as affected revisions. That master identifier shares the tested commit's recorded prefix, 65a4125; our run did not reproduce or verify the report.

PR #2699 proposes enforcing the check before ReadyForQuery. It is open and unmerged in the supplied snapshot. Its author's reported test results are not our measurements and do not establish a shipped fix. Both records are included in the supplied open issue and PR snapshot.

The same snapshot includes PR #2694, whose author reports that malformed connection URIs containing an unencoded @ in a password can leave password fragments visible in parsing errors. The author reports reproduction on v5.11.0 and master d6d4b01c. This PR is also open and unmerged in the supplied snapshot. We did not independently verify the report or its proposed correction.

These are attributed, unverified reports, not confirmed vulnerabilities established by our run. Teams relying on require_auth, or logging connection-parse errors, should resolve their applicability and fix status for the exact revision they intend to deploy. The supplied evidence does not establish either report as the cause of the tracelog failures.

pq and sqlx address different needs

pq is a Go PostgreSQL driver for database/sql. Compare it with pgx's stdlib adapter when choosing a driver behind an existing database/sql interface. This review supplies no measured performance comparison between them.

sqlx extends database/sql with struct mapping and named parameters. It is an integration option when those conveniences are the missing capability, rather than a replacement for the database driver. Its supplied example uses a separate PostgreSQL driver.

Documentation receives 4/5 under this review's rubric: 1 means absent guidance, 3 means a basic documented path, 4 means explicit guidance on interface selection, connectivity and connection release, and 5 additionally requires reproduced integration evidence. The supplied documentation supports the 4; our run does not support the 5. Before adopting pgx, resolve the relevant open reports for the selected revision and make the chosen interface complete a representative query with correct connection release.

Alternatives

ProjectWhat it isPick it when
pqA Go PostgreSQL driver for database/sql.Compare pq with pgx's stdlib adapter when choosing a PostgreSQL driver while retaining an existing database/sql interface. The supplied evidence does not establish a performance winner.
sqlxExtensions to database/sql for struct mapping and named parameters.Consider sqlx when an existing database/sql application needs struct mapping or named parameters. It supplements a database driver rather than replacing one.

What people are saying

  1. [github-trending] jackc/pgx

Sources

  1. pgx README
  2. pgxpool API reference
  3. pq README
  4. sqlx README
  5. Repository metadata
  6. Open issue and PR snapshot

More data reviews

jq · HowToLiveLonger · ip2region · dbdelve · litestream · tesseract · the whole board →