# brianc/node-postgres

PostgreSQL client for node.js.

Repository: https://github.com/brianc/node-postgres
Canonical: https://ross.abutalabs.com/products/node-postgres
Homepage: https://node-postgres.com
Language: JavaScript
License: MIT
License Family: permissive
Topics: postgresql, postgresql-driver, node-postgres, postgres, libpq
Last push: 2026-08-18T22:27:03+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 35, longevity 100
- inputs: {"age_days": 5801, "days_push": 15, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 13198, forks 1345 (observed 2026-08-28T04:11:02.499508+00:00)

## What it is
node-postgres (pg) is the de facto PostgreSQL client library for Node.js, also supporting bun, deno, and cloudflare workers. It provides a non-blocking pure JavaScript client with optional native libpq bindings, connection pooling, parameterized queries, streaming, cursors, and extensible data-type parsing.

## Use cases
- connect to postgres from node.js
- run parameterized sql queries safely
- pool database connections for a web app
- stream large query results
- listen for postgres notifications with LISTEN/NOTIFY
- bulk import and export with COPY
- run transactions from node
- connect to postgres over ssl

## When to choose
- you need a mature, battle-tested PostgreSQL driver for Node.js or bun/deno
- you want connection pooling, prepared statements, and rich type parsing out of the box
- you need low-level control over queries and transactions without heavy ORM abstractions

## When to avoid
- you want a high-level ORM with migrations and model relations
- you are connecting to a database other than PostgreSQL
- you need dynamic identifiers/table names built in (use pg-format alongside)

## Facets
- artifact type: library
- maturity: stable
- function: database-driver, database, http-server
- domain: databases, backend, web-development, developer-tools
- platform: bun, cross-platform
- tags: postgresql, pg, connection-pooling, sql, libpq, prepared-statements, ssl, query-pipelining, nodejs, deno

## Member repositories
- brianc/node-postgres (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:02.499508+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:13:27.196369+00:00, confidence not recorded.
  - readme: https://github.com/brianc/node-postgres (fetched 2026-08-28T04:11:02.499508+00:00, sha f2d6096f0a72)
  - homepage: https://node-postgres.com (fetched 2026-08-29T08:09:10.403047+00:00, sha 56910f40d6bf)
  - site_page: https://node-postgres.com/features/connecting (fetched 2026-08-29T08:09:10.412334+00:00, sha ad1fa0b6eca4)
  - site_page: https://node-postgres.com/features/queries (fetched 2026-08-29T08:09:10.414478+00:00, sha e2c30d5f861c)
  - site_page: https://node-postgres.com/features/pipelining (fetched 2026-08-29T08:09:10.416281+00:00, sha 2bb220bafc97)
  - site_page: https://node-postgres.com/features/pooling (fetched 2026-08-29T08:09:10.417919+00:00, sha 04c14cad61b4)
  - site_page: https://node-postgres.com/features/transactions (fetched 2026-08-29T08:09:10.419569+00:00, sha e1ffaff7389d)
  - site_page: https://node-postgres.com/features/types (fetched 2026-08-29T08:09:10.421348+00:00, sha 48ea704afbf7)
  - site_page: https://node-postgres.com/features/ssl (fetched 2026-08-29T08:09:10.423221+00:00, sha 4b523d7689dc)
  - site_page: https://node-postgres.com/features/native (fetched 2026-08-29T08:09:10.425084+00:00, sha d44a41c83f58)
- Data as of 2026-08-30T08:39:29.467469+00:00.
