# xataio/pgstream

PostgreSQL replication with DDL changes

Repository: https://github.com/xataio/pgstream
Canonical: https://ross.abutalabs.com/products/pgstream
Homepage: https://xata.io/docs/opensource/pgstream/overview
Language: Go
License: Apache-2.0
License Family: permissive
Topics: golang, postgresql, replication, ddl, elasticsearch, opensearch, webhooks, schema, snapshots, anonymization
Last push: 2026-09-02T15:38:14+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 100, release rhythm 88, longevity 62
- inputs: {"age_days": 875, "days_push": 0, "days_rel": 0, "gap_med": 5, "n_releases_24m": 68}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1186, forks 79 (observed 2026-09-03T02:15:20.646954+00:00)

## What it is
pgstream is an open-source change data capture (CDC) tool and Go library that replicates PostgreSQL data, including DDL/schema changes, to targets such as PostgreSQL, Elasticsearch/OpenSearch, webhooks, or Kafka. It also supports initial and on-demand snapshots and column-level value transformations for anonymizing data in flight.

## Use cases
- replicate postgres to elasticsearch including schema changes
- stream postgres changes to another database with ddl support
- set up change data capture for postgresql
- anonymize data while replicating postgres
- take an initial snapshot of a postgres database
- sync postgres tables to opensearch
- send postgres change events to webhooks
- replicate postgres to kafka with schema-based partitioning

## When to choose
- you need Postgres CDC that also propagates DDL/schema changes, which most CDC tools ignore
- you want to keep Elasticsearch or OpenSearch in sync with Postgres
- you need to mask or anonymize column values during replication
- you want a lightweight, modular pipeline that only requires Postgres and is extensible with custom targets

## When to avoid
- your source database is not PostgreSQL
- you need a fully managed replication service with a GUI
- you only need simple one-off backups rather than change streaming
- you require targets other than Postgres, Elasticsearch/OpenSearch, webhooks, or Kafka without writing custom code

## Facets
- artifact type: cli-tool
- maturity: active
- function: database, etl, streaming, search-engine, webhook, cli
- domain: databases, privacy, developer-tools
- platform: go, self-hosted, cli
- tags: cdc, postgres-replication, ddl-replication, logical-replication, elasticsearch-indexing, opensearch, data-anonymization, snapshots, kafka, change-data-capture, data-engineering, search, linux, macos, docker

## Member repositories
- xataio/pgstream (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-09-03T02:15:20.646954+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-30T06:24:59.566600+00:00, confidence not recorded.
  - readme: https://github.com/xataio/pgstream (fetched 2026-09-03T02:15:20.646954+00:00, sha 76e269b767c3)
  - homepage: https://xata.io/documentation/opensource/pgstream/overview (fetched 2026-08-29T12:31:59.154349+00:00, sha de8544212901)
  - site_page: https://xata.io/docs (fetched 2026-08-29T12:31:59.165097+00:00, sha de8544212901)
  - site_page: https://xata.io/docs/api-reference/organizations/get-list-of-organizations (fetched 2026-08-29T12:31:59.166704+00:00, sha b9262a3bcd1c)
  - site_page: https://xata.io/docs/cli (fetched 2026-08-29T12:31:59.168459+00:00, sha 42ef7add959e)
  - site_page: https://xata.io/docs/quickstart (fetched 2026-08-29T12:31:59.170304+00:00, sha 5dac8032fa6b)
  - site_page: https://xata.io/docs/core-concepts/branching (fetched 2026-08-29T12:31:59.172100+00:00, sha e8da67742544)
  - site_page: https://xata.io/docs/core-concepts/anonymization (fetched 2026-08-29T12:31:59.174056+00:00, sha eafd505ee8b4)
  - site_page: https://xata.io/docs/core-concepts/schema-changes (fetched 2026-08-29T12:31:59.175768+00:00, sha 0a7eb8f459af)
- Data as of 2026-08-30T08:39:29.467469+00:00.
