Skip to content

New PGSync ClickHouse: stream Postgres into ClickHouse

Search your relational data by meaning, in real time.

PGSync keeps Elasticsearch and OpenSearch in sync with PostgreSQL, MySQL and MariaDB. PGSync Semantic lets your users search by meaning, with hybrid keyword ranking, and re-embeds a document only when its meaning changes.

$ pip install pgsync
// query: "a rebellion against a watchful state"
{
  "title": "Nineteen Eighty-Four",
  "author": ["George Orwell"]
}
{
  "table": "book",
  "columns": ["isbn", "title", "description"],
  "children": [
    { "table": "author", "columns": ["name"] }
  ]
}
PostgreSQLMySQLMariaDB PGSync ElasticsearchOpenSearchClickHouse

One sync engine, four products

  • PGSync Semantic

    From $29/mo

    Semantic and hybrid search on your own data. Embeddings update only when the meaning changes. Includes an MCP server for AI agents.

    Explore Semantic

  • PGSync

    Free, MIT

    The open-source sync engine. Nested JSON documents in Elasticsearch and OpenSearch, kept in sync in real time.

    Get started

  • PGSync ClickHouse

    Mirror free, from $19/mo

    Stream Postgres into ClickHouse. Mirror one table, or flatten a whole tree into one wide table.

    Explore ClickHouse

  • django-pgsync

    Free, open source

    Declare search indexes from your Django models. PGSync catches every write, also the ones that skip signals.

    Django integration

What is PGSync?

PGSync is a lightweight middleware that captures changes from your relational database and writes structured, denormalized documents to your search cluster.

Define your document schema once in JSON, and PGSync handles change capture, ordering, and delivery automatically, no custom ETL code required.

  • Change Data Capture


    Automatically captures INSERT, UPDATE, and DELETE using logical replication

  • Low Overhead


    Minimal impact on database performance

  • Fault Tolerant


    Resumes from last checkpoint after crashes

  • Nested Documents


    Transform relational data into deeply nested JSON

Quick Start

$ pip install pgsync
---> 100%
Successfully installed pgsync

Define your schema in JSON:

schema.json
{
  "database": "mydb",
  "index": "books",
  "nodes": {
    "table": "book",
    "children": [{ "table": "author" }]
  }
}

Then start syncing:

$ pgsync --config schema.json --daemon

PGSync is supported by DigitalOcean.

DigitalOcean