PeerDB is now natively integrated with ClickHouse Cloud!We recently announced the Postgres CDC connector in ClickPipes, now available in Public Preview.
This connector is fully powered by PeerDB.As a ClickHouse Cloud customer, you get a seamless, native experience for moving data from your Postgres databases to ClickHouse Cloud. Simply navigate to the Data Sources tab and add a Postgres source to start ingesting data.
Once PeerDB is connected to your PostgreSQL database or read replica, we will first do a full initial load of all the selected tables from your database. Then the continuous sync process will start using WAL to capture changes from the source database and apply them to the destination database.PeerDB will try to match the data types of the source and destination tables as closely as possible. If there are any data types that we are unable to match, we will use TEXT as the default data type. For data type mapping reference, please refer to the Data Type Mapping page.
1
Create Mirror Screen
Click on Mirrors tab and then enter new Mirror screen
2
Mirror Type
Since in this walk through we are focussing on CDC based replication, choose CDC as the mirror type.
3
Mirror Name
Enter a unique identifier for the mirror name. This is used to identify the mirror in the PeerDB UI. Make this alpha numeric and without any special characters except underscore. Typically users use something like: prod_pg_to_clickhouse_v1 or dev_pg_to_clickhouse.
4
Select Source and Destination Peers
Select the source and destination peers that you created in the prerequisites in the drop down.
source and destination drop down
5
Mirror Configuration
Initial Snapshot: Selecting this option will do a full initial load of all the selected tables from your database. This is useful when you are setting up the mirror for the first time. Default is enabled.
Sync Interval (Seconds): This is the interval at which PeerDB will poll the source database for changes. Default is 60 seconds. This has implication on the warehouse activity, for cost-sensitive users we recommend to keep this at a higher value (over 3600).
Publication Name: This is the name of the publication that you created in the source database. This is used to capture changes from the source database. If you have not created a publication, you can leave this blank and PeerDB will create a publication for you. If you have not created a publication, you can leave this blank and PeerDB will create a publication for you. If you have already created a publication dedicated to peerdb (peerdb_publication), don’t forget adding that in this field.
Replication Slot Name: This is the name of the replication slot that you created in the source database. This is used to capture changes from the source database. If you have not created a replication slot, you can leave this blank and PeerDB will create a replication slot for you.
Snapshot Number of Rows Per Partition: This is the number of rows that will be fetched in each partition during the initial snapshot. Default is 500000. This is useful when you have a large number of rows in your tables and you want to control the number of rows fetched in each partition.
Snapshot Maximum Parallel Workers: This is the number of parallel workers that will be used to fetch the initial snapshot. Default is 1. This is useful when you have a large number of tables and you want to control the number of parallel workers used to fetch the initial snapshot. This setting is per-table.
Snapshot Number of Tables In Parallel: This is the number of tables that will be fetched in parallel during the initial snapshot. Default is 4. This is useful when you have a large number of tables and you want to control the number of tables fetched in parallel.
Soft Delete: This is set to false by default. If you want to capture soft deletes, you can set this to true. This will add a _peerdb_is_deleted column to the destination table and set it to true when a row is deleted in the source table without actually deleting the row in the destination table.
6
Table Selection
Select the tables that you want to replicate from the source database to the destination database. You can use the search bar to search for the tables. You can also use the filter to filter the tables based on the schema.
Table Selection
7
Review and Create
Review the mirror configuration and click on the Validate Mirror button. If there are any errors, you will see them on the screen. If there are no errors, you will see a success message. Once you see the success message, click on the Create Mirror button to create the mirror ✨.
Once you’ve moved data from Postgres to ClickHouse, the next obvious question is how to model your data in ClickHouse to make the most of it. Please refer to this page on ClickHouse Data Modeling Tips for Postgres users to help you model data in ClickHouse.
This is especially important as ClickHouse differs from Postgres, and you might encounter some surprises. This guide helps address potential pitfalls and ensures you can take full advantage of ClickHouse.
If Ordering Key in ClickHouse is different from PRIMARY KEY in Postgres
If you are defining a Ordering Key in ClickHouse differently from the Primary Key in Postgres, please don’t forget to read all the considerations around it!
When replicating data from PostgreSQL to ClickHouse, it’s important to understand the limitations and special considerations for TOAST (The Oversized-Attribute Storage Technique) columns. This guide will help you identify and properly handle TOAST columns in your replication process.
Please refer to this page on Handling TOAST Columns to help you handle TOAST columns in your replication process.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"PeerDB Docs: Setup your ETL in minutes with SQL.","colors":{"primary":"#248736","light":"#248736","dark":"#248736"},"favicon":"https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/favicon.png?fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=bcb6625d7fc622364e8380f49bc07790","logo":{"light":"https://mintcdn.com/peerdb/wtgPI5cQwjI2FO0m/logo/docs-logo-light.png?fit=max\u0026auto=format\u0026n=wtgPI5cQwjI2FO0m\u0026q=85\u0026s=90ac5de385106617a465b7ba4d33a28e","dark":"https://mintcdn.com/peerdb/wtgPI5cQwjI2FO0m/logo/docs-logo-dark.png?fit=max\u0026auto=format\u0026n=wtgPI5cQwjI2FO0m\u0026q=85\u0026s=feffd926023e0bcf9c5d4282d426fe12"},"navbar":{"primary":{"type":"button","label":"Get Started","href":"https://app.peerdb.cloud"}},"footer":{"socials":{"github":"https://github.com/PeerDB-io"}},"integrations":{"ga4":{"measurementId":"G-1V9ZZCZMB7"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"peerdb","hasAudioNarration":false,"actualSubdomain":"peerdb","customDomains":["docs.peerdb.io"],"gitSource":{"type":"github","owner":"peerdb-io","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a8893018e352becf1ac8d39","collectionId":"dc037637-3209-4796-8664-2e77fd9c1f6c","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a8893018e352becf1ac8d39"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6a8893018e352becf1ac8d39:success","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Documentation","count":75},{"language":"default","tag":"Setup","count":17},{"language":"default","tag":"API Reference","count":14},{"language":"default","tag":"API Endpoints","count":14},{"language":"default","tag":"Use-cases","count":12},{"language":"default","tag":"SQL Reference","count":10},{"language":"default","tag":"SQL Commands","count":10},{"language":"default","tag":"PostgreSQL Setup Guide","count":9},{"language":"default","tag":"Features","count":9},{"language":"default","tag":"Mirror","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"mirror/cdc-pg-clickhouse","slug":"/mirror/cdc-pg-clickhouse","pageMetadata":{"title":"CDC Setup from Postgres to ClickHouse","description":null,"href":"/mirror/cdc-pg-clickhouse"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const postgresProviderType_0=`PostgreSQL database or read replica`;function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Frame,Heading,Info,Note,OptimizedImage,Step,Steps}=_components;if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);return _jsxs(_Fragment,{children:[_jsxs(Note,{children:[_jsx(`b`,{children:`PeerDB is now natively integrated with ClickHouse Cloud!`}),_jsx(_components.p,{children:`We recently announced the Postgres CDC connector in ClickPipes, now available in Public Preview.\nThis connector is fully powered by PeerDB.`}),_jsxs(_components.p,{children:[`As a ClickHouse Cloud customer, you get a seamless, native experience for moving data from your Postgres databases to ClickHouse Cloud. Simply navigate to the `,_jsx(_components.strong,{children:`Data Sources`}),` tab and add a Postgres source to start ingesting data.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsx(_components.p,{children:`To perform CDC from Postgres to ClickHouse, you first need to create a source and destination Peer.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Create a Source Peer for Postgres. Follow the instructions depending on your Postgres instance:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/connect/postgres/rds_postgres`,children:`RDS`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/connect/postgres/cloudsql_postgres`,children:`Cloud SQL`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/connect/postgres/azure_flexible_server_postgres`,children:`Azure Flexible Server`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/connect/postgres/crunchy_bridge`,children:`Crunchy Bridge`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/connect/postgres/neon_postgres`,children:`Neon`})}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Create a Destination Peer for ClickHouse`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/connect/clickhouse`,children:`ClickHouse`})}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`mirror-overview`,children:`Mirror Overview`}),`\n`,_jsxs(_components.p,{children:[`Once PeerDB is connected to your `,postgresProviderType_0,`, we will first do a full initial load of all the selected tables from your database. Then the continuous sync process will start using WAL to capture changes from the source database and apply them to the destination database.`]}),`\n`,_jsxs(_components.p,{children:[`PeerDB will try to match the data types of the source and destination tables as closely as possible. If there are any data types that we are unable to match, we will use `,_jsx(_components.code,{children:`TEXT`}),` as the default data type. For data type mapping reference, please refer to the `,_jsx(_components.a,{href:`/datatypes/datatype-matrix`,children:`Data Type Mapping`}),` page.`]}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Create Mirror Screen`,children:_jsx(Frame,{caption:`Click on Mirrors tab and then enter new Mirror screen`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/new-mirror-1.jpeg?fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=71bd733918b0ed8ddea5e0e3be42a32a`,\"data-og-width\":`3456`,width:`3456`,\"data-og-height\":`1916`,height:`1916`,\"data-path\":`images/cdc/new-mirror-1.jpeg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/new-mirror-1.jpeg?w=280\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=d3f29cfb2b62a420789ae74ab7207889 280w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/new-mirror-1.jpeg?w=560\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=d3027258fc33e5b32dbb588b0369041c 560w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/new-mirror-1.jpeg?w=840\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=17feac25bf58cf724e3c24dbb5a70bd1 840w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/new-mirror-1.jpeg?w=1100\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=ef9e21910c8cbada09e7841a063facb5 1100w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/new-mirror-1.jpeg?w=1650\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=9c1580a6d9cb0f5ba358e30ec95ace63 1650w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/new-mirror-1.jpeg?w=2500\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=0679433024e57f21afd9f7f816b70c51 2500w`})})}),_jsx(Step,{title:`Mirror Type`,children:_jsx(_components.p,{children:`Since in this walk through we are focussing on CDC based replication, choose CDC as the mirror type.`})}),_jsx(Step,{title:`Mirror Name`,children:_jsxs(_components.p,{children:[`Enter a unique identifier for the mirror name. This is used to identify the mirror in the PeerDB UI. Make this alpha numeric and without any special characters except underscore. Typically users use something like: `,_jsx(_components.code,{children:`prod_pg_to_clickhouse_v1`}),` or `,_jsx(_components.code,{children:`dev_pg_to_clickhouse`}),`.`]})}),_jsxs(Step,{title:`Select Source and Destination Peers`,children:[_jsx(_components.p,{children:`Select the source and destination peers that you created in the prerequisites in the drop down.`}),_jsx(Frame,{caption:`source and destination drop down`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/pg-ch-dropdown.jpeg?fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=769e7a37995c91e77036d4926a36df39`,\"data-og-width\":`1742`,width:`1742`,\"data-og-height\":`252`,height:`252`,\"data-path\":`images/cdc/pg-ch-dropdown.jpeg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/pg-ch-dropdown.jpeg?w=280\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=f9880a710f6fc0caf120089e1983061e 280w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/pg-ch-dropdown.jpeg?w=560\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=bb3206990bd7419d66d8d85fa051a279 560w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/pg-ch-dropdown.jpeg?w=840\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=f3f6e3ba5e06541ebc9e00b6ba824bd9 840w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/pg-ch-dropdown.jpeg?w=1100\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=e350fda7bd9ba55647b2895564c4bc4e 1100w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/pg-ch-dropdown.jpeg?w=1650\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=46a0ff2ddbd02dd534ada1b393904fea 1650w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/pg-ch-dropdown.jpeg?w=2500\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=ca11d764735a9ad03e5484901a8bbf15 2500w`})})]}),_jsx(Step,{title:`Mirror Configuration`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Initial Snapshot`}),`: Selecting this option will do a full initial load of all the selected tables from your database. This is useful when you are setting up the mirror for the first time. Default is enabled.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Sync Interval (Seconds)`}),`: This is the interval at which PeerDB will poll the source database for changes. Default is `,_jsx(_components.code,{children:`60`}),` seconds. This has implication on the warehouse activity, for cost-sensitive users we recommend to keep this at a higher value (over `,_jsx(_components.code,{children:`3600`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Publication Name`}),`: This is the name of the publication that you created in the source database. This is used to capture changes from the source database. If you have not created a publication, you can leave this blank and PeerDB will create a publication for you. If you have not created a publication, you can leave this blank and PeerDB will create a publication for you. If you have already created a publication dedicated to peerdb (`,_jsx(_components.code,{children:`peerdb_publication`}),`), don’t forget adding that in this field.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Replication Slot Name`}),`: This is the name of the replication slot that you created in the source database. This is used to capture changes from the source database. If you have not created a replication slot, you can leave this blank and PeerDB will create a replication slot for you.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Snapshot Number of Rows Per Partition`}),`: This is the number of rows that will be fetched in each partition during the initial snapshot. Default is `,_jsx(_components.code,{children:`500000`}),`. This is useful when you have a large number of rows in your tables and you want to control the number of rows fetched in each partition.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Snapshot Maximum Parallel Workers`}),`: This is the number of parallel workers that will be used to fetch the initial snapshot. Default is `,_jsx(_components.code,{children:`1`}),`. This is useful when you have a large number of tables and you want to control the number of parallel workers used to fetch the initial snapshot. This setting is per-table.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Snapshot Number of Tables In Parallel`}),`: This is the number of tables that will be fetched in parallel during the initial snapshot. Default is `,_jsx(_components.code,{children:`4`}),`. This is useful when you have a large number of tables and you want to control the number of tables fetched in parallel.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Soft Delete`}),`: This is set to `,_jsx(_components.code,{children:`false`}),` by default. If you want to capture soft deletes, you can set this to `,_jsx(_components.code,{children:`true`}),`. This will add a `,_jsx(_components.code,{children:`_peerdb_is_deleted`}),` column to the destination table and set it to `,_jsx(_components.code,{children:`true`}),` when a row is deleted in the source table without actually deleting the row in the destination table.`]}),`\n`]})}),_jsxs(Step,{title:`Table Selection`,children:[_jsx(_components.p,{children:`Select the tables that you want to replicate from the source database to the destination database. You can use the search bar to search for the tables. You can also use the filter to filter the tables based on the schema.`}),_jsx(Frame,{caption:`Table Selection`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/table-selector-ch.jpeg?fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=cd6c583a2a5f913e78bd444f782cd5be`,\"data-og-width\":`1752`,width:`1752`,\"data-og-height\":`1096`,height:`1096`,\"data-path\":`images/cdc/table-selector-ch.jpeg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/table-selector-ch.jpeg?w=280\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=eb61a8dfba7ea3f43a64e53680d8f55b 280w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/table-selector-ch.jpeg?w=560\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=0a3fd7885c4603edf983448d4dcdde70 560w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/table-selector-ch.jpeg?w=840\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=0b33a4db1438e19166b8ed474e6badfb 840w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/table-selector-ch.jpeg?w=1100\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=3a450d3afc998628b1892e1a87584fe2 1100w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/table-selector-ch.jpeg?w=1650\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=c053edf3c8dac96d15de697e2fe6bbdb 1650w, https://mintcdn.com/peerdb/MRN5BST_xrBv7brJ/images/cdc/table-selector-ch.jpeg?w=2500\u0026fit=max\u0026auto=format\u0026n=MRN5BST_xrBv7brJ\u0026q=85\u0026s=2c0eb819eb40058cc087286701599363 2500w`})})]}),_jsx(Step,{title:`Review and Create`,children:_jsxs(_components.p,{children:[`Review the mirror configuration and click on the `,_jsx(_components.code,{children:`Validate Mirror`}),` button. If there are any errors, you will see them on the screen. If there are no errors, you will see a success message. Once you see the success message, click on the `,_jsx(_components.code,{children:`Create Mirror`}),` button to create the mirror ✨.`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`data-modeling-on-clickhouse-important`,children:`Data Modeling on ClickHouse [IMPORTANT]`}),`\n`,_jsxs(_components.p,{children:[`Once you’ve moved data from Postgres to ClickHouse, the next obvious question is how to model your data in ClickHouse to make the most of it. Please refer to this page on `,_jsx(_components.a,{href:`/bestpractices/clickhouse_datamodeling`,children:`ClickHouse Data Modeling Tips for Postgres users`}),` to help you model data in ClickHouse.`]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/bestpractices/clickhouse_datamodeling`,children:`This`}),` is especially important as ClickHouse differs from Postgres, and you might encounter some surprises. This guide helps address potential pitfalls and ensures you can take full advantage of ClickHouse.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`if-ordering-key-in-clickhouse-is-different-from-primary-key-in-postgres`,children:`If Ordering Key in ClickHouse is different from PRIMARY KEY in Postgres`}),`\n`,_jsxs(_components.p,{children:[`If you are defining a Ordering Key in ClickHouse differently from the Primary Key in Postgres, please don’t forget to read all the `,_jsx(_components.a,{href:`/mirror/ordering-key-different`,children:`considerations`}),` around it!`]}),`\n`,_jsx(Heading,{level:`2`,id:`handling-toast-columns`,children:`Handling TOAST Columns`}),`\n`,_jsx(_components.p,{children:`When replicating data from PostgreSQL to ClickHouse, it’s important to understand the limitations and special considerations for TOAST (The Oversized-Attribute Storage Technique) columns. This guide will help you identify and properly handle TOAST columns in your replication process.`}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Please refer to this page on `,_jsx(_components.a,{href:`/bestpractices/clickhouse_toast_columns`,children:`Handling TOAST Columns`}),` to help you handle TOAST columns in your replication process.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{postgresProviderType_0,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"CDC Setup from Postgres to ClickHouse","description":null,"href":"/mirror/cdc-pg-clickhouse"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[2809,2834,"`PostgreSQL database or read replica`,`,"]]},"mdxExtracts":{"tableOfContents":[{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Mirror Overview","slug":"mirror-overview","depth":2,"children":[]},{"title":"Data Modeling on ClickHouse [IMPORTANT]","slug":"data-modeling-on-clickhouse-important","depth":2,"children":[]},{"title":"If Ordering Key in ClickHouse is different from PRIMARY KEY in Postgres","slug":"if-ordering-key-in-clickhouse-is-different-from-primary-key-in-postgres","depth":2,"children":[]},{"title":"Handling TOAST Columns","slug":"handling-toast-columns","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"peerdb","siteName":"PeerDB Docs: Setup your ETL in minutes with SQL.","title":"CDC Setup from Postgres to ClickHouse - PeerDB Docs: Setup your ETL in minutes with SQL.","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-21T18:07:55.675Z","originalFileLocation":"mirror/cdc-pg-clickhouse.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"PeerDB Docs: Setup your ETL in minutes with SQL.\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"CDC Setup from Postgres to ClickHouse - PeerDB Docs: Setup your ETL in minutes with SQL.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PeerDB Docs: Setup your ETL in minutes with SQL.\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://peerdb.mintlify.app/_mintlify/api/og/v2?division=Mirror\u0026amp;title=CDC+Setup+from+Postgres+to+ClickHouse\u0026amp;theme=fca96d2023807749157a0c65\u0026amp;signature=5c4f39918dc70c41ba77198351110c2359512e1fbdf6cd0cd07446aedfdfbd52\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"CDC Setup from Postgres to ClickHouse - PeerDB Docs: Setup your ETL in minutes with SQL.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://peerdb.mintlify.app/_mintlify/api/og/v2?division=Mirror\u0026amp;title=CDC+Setup+from+Postgres+to+ClickHouse\u0026amp;theme=fca96d2023807749157a0c65\u0026amp;signature=5c4f39918dc70c41ba77198351110c2359512e1fbdf6cd0cd07446aedfdfbd52\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/peerdb/AsJEjbO1FwDhXakS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PeerDB Docs: Setup your ETL in minutes with SQL.\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#248736\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/mirror/cdc-pg-clickhouse.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.peerdb.io/#organization\",\"name\":\"PeerDB Docs: Setup your ETL in minutes with SQL.\",\"url\":\"https://docs.peerdb.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/peerdb/wtgPI5cQwjI2FO0m/logo/docs-logo-light.png?fit=max\u0026auto=format\u0026n=wtgPI5cQwjI2FO0m\u0026q=85\u0026s=90ac5de385106617a465b7ba4d33a28e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.peerdb.io#website\",\"name\":\"PeerDB Docs: Setup your ETL in minutes with SQL.\",\"url\":\"https://docs.peerdb.io\",\"publisher\":{\"@id\":\"https://docs.peerdb.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse#webpage\",\"url\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse\",\"name\":\"CDC Setup from Postgres to ClickHouse\",\"dateModified\":\"2026-08-21T18:07:55.675Z\",\"isPartOf\":{\"@id\":\"https://docs.peerdb.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PeerDB Docs: Setup your ETL in minutes with SQL.\",\"item\":\"https://docs.peerdb.io\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CDC Setup from Postgres to ClickHouse\",\"item\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse#article\",\"headline\":\"CDC Setup from Postgres to ClickHouse\",\"name\":\"CDC Setup from Postgres to ClickHouse\",\"url\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse\",\"mainEntityOfPage\":{\"@id\":\"https://docs.peerdb.io/mirror/cdc-pg-clickhouse#webpage\"},\"dateModified\":\"2026-08-21T18:07:55.675Z\",\"publisher\":{\"@id\":\"https://docs.peerdb.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.peerdb.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PeerDB Docs: Setup your ETL in minutes with SQL.\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PeerDB Docs: Setup your ETL in minutes with SQL.","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Home","pages":[{"title":"PeerDB","href":"/introduction"},{"title":"Architecture Overview","href":"/architecture"},{"title":"Why choose PeerDB over other tools?","href":"/why-peerdb"}]},{"group":"Quickstart","pages":[{"title":"Quickstart Guide","href":"/quickstart/quickstart"},{"title":"PeerDB Streams for Kafka Quickstart Guide","href":"/quickstart/streams-quickstart"},{"title":"SQL Quickstart Guide","href":"/quickstart/sql-quickstart"}]},{"group":"PeerDB Cloud","pages":[{"title":"PeerDB Cloud Quickstart Guide","icon":"rocket","iconType":"solid","href":"/peerdb-cloud/cloud-quickstart"},{"title":"PeerDB Cloud Security","icon":"lock","iconType":"solid","href":"/peerdb-cloud/cloud-security"},{"title":"PeerDB Cloud Pricing FAQ","icon":"question","iconType":"solid","href":"/peerdb-cloud/peerdb-cloud-pricing-faq"},{"title":"Trust Center","url":"https://trust.peerdb.io/","icon":"shield-halved","iconType":"solid","href":"/peerdb-cloud/cloud-trust-center"},{"title":"Public IPs For PeerDB Cloud","icon":"server","iconType":"regular","href":"/peerdb-cloud/ip-table"},{"title":"AWS Private Link","icon":"diagram-project","iconType":"solid","href":"/peerdb-cloud/aws-private-link"}]},{"group":"Setup","pages":[{"group":"PostgreSQL Setup Guide","pages":[{"title":"RDS Postgres Source Setup Guide","href":"/connect/postgres/rds_postgres"},{"title":"Supabase Postgres Source Setup Guide on PeerDB Cloud","href":"/connect/postgres/supabase_postgres_peerdb_cloud"},{"title":"Supabase Postgres Source Setup Guide","href":"/connect/postgres/supabase_postgres"},{"title":"Google CloudSQL Postgres Source Setup Guide","href":"/connect/postgres/cloudsql_postgres"},{"title":"Azure Flexible Server Postgres Source Setup Guide","href":"/connect/postgres/azure_flexible_server_postgres"},{"title":"Crunchy Bridge Postgres Source Setup Guide","href":"/connect/postgres/crunchy_bridge"},{"title":"Neon Postgres Source Setup Guide","href":"/connect/postgres/neon_postgres"},{"title":"Generic PostgreSQL Source Setup Guide","href":"/connect/postgres/generic_postgres"},{"title":"Unsupported PostgreSQL Providers","href":"/connect/postgres/unsupported_providers"}]},{"title":"CockroachDB Source Setup Guide","href":"/connect/cockroachdb"},{"group":"Clickhouse Setup Guide","pages":[{"title":"ClickHouse Cloud Setup Guide","href":"/connect/clickhouse/clickhouse-cloud"},{"title":"ClickHouse Setup Guide","href":"/connect/clickhouse/clickhouse"}]},{"title":"Snowflake Setup Guide","href":"/connect/snowflake"},{"title":"BigQuery Setup Guide","href":"/connect/bigquery"},{"title":"GCS Setup Guide","href":"/connect/gcs"},{"title":"S3 Setup Guide","href":"/connect/s3"},{"title":"Elasticsearch Setup Guide","href":"/connect/elasticsearch"}]},{"group":"Queues Setup","pages":[{"title":"Kafka Setup Guide","href":"/connect/kafka"},{"title":"Confluent Cloud Setup Guide","href":"/connect/confluent-cloud"},{"title":"PubSub Setup Guide","description":null,"href":"/connect/pubsub"}]},{"group":"Mirror","pages":[{"title":"CDC Setup from Postgres to ClickHouse","href":"/mirror/cdc-pg-clickhouse"},{"title":"CDC Setup from Supabase to ClickHouse","description":null,"href":"/mirror/cdc-supabase-clickhouse"},{"title":"CDC Setup from Neon Postgres to ClickHouse","href":"/mirror/cdc-neon-clickhouse"},{"title":"CDC Setup from Postgres to Bigquery","href":"/mirror/cdc-pg-bq"},{"title":"CDC Setup from Postgres to Snowflake","href":"/mirror/cdc-pg-sf"},{"title":"CDC Setup from Postgres to Postgres","href":"/mirror/cdc-pg-pg"},{"title":"CDC Setup from Postgres to Kafka","href":"/mirror/cdc-pg-kafka"},{"title":"CDC Setup from Postgres to Elasticsearch","href":"/mirror/cdc-pg-elasticsearch"},{"title":null,"href":"/mirror/upgrade"}]},{"group":"5-minute Tutorials","pages":[{"title":"Streaming Query Replication of PostgreSQL To Snowflake","href":"/tutorials/realtime-streaming-of-query-results"}]},{"group":"Features","pages":[{"title":"Pausing a CDC Mirror","href":"/features/pause-mirror"},{"title":"Editing a CDC Mirror","href":"/features/edit-mirror"},{"title":"Resyncing a CDC Mirror","href":"/features/resync-mirror"},{"title":"Schema Changes Propagation Support","href":"/features/schema-changes"},{"title":null,"href":"/features/replicating-partitioned-tables"},{"title":null,"href":"/features/feature-matrix"},{"title":null,"href":"/features/supported-connectors"},{"group":"Alerting","pages":[{"title":"Slack Alerting","href":"/features/alerting/slack-alerting"},{"title":"Email Alerting","href":"/features/alerting/email-alerting"}]}]},{"group":"Data types","pages":[{"title":null,"href":"/datatypes/datatype-matrix"}]},{"group":"Best practices","pages":[{"title":"Postgres to ClickHouse: Data Modeling Tips","href":"/bestpractices/clickhouse_datamodeling"},{"title":"Heartbeat Table For CDC","href":"/bestpractices/heartbeat"},{"title":"Upgrading the PostgreSQL Peer Of An Ongoing CDC Mirror","href":"/bestpractices/postgres-upgrade"},{"title":"Generated Columns: Gotchas and Best Practices","href":"/bestpractices/generated_columns"},{"title":"Postgres to ClickHouse: Handling TOAST Columns","href":"/bestpractices/clickhouse_toast_columns"},{"title":"Defining the Ordering Key in ClickHouse differently from the Primary Key in Postgres","href":"/bestpractices/ordering-key-different"}]},{"group":"Use-cases","pages":[{"group":"Real-time Change Data Capture from Postgres","pages":[{"title":"Overview","href":"/usecases/real-time-cdc/overview"},{"title":"PostgreSQL To PostgreSQL","href":"/usecases/real-time-cdc/postgres-to-postgres"},{"title":"PostgreSQL to BigQuery","href":"/usecases/real-time-cdc/postgres-to-bigquery"},{"title":"PostgreSQL To Snowflake","href":"/usecases/real-time-cdc/postgres-to-snowflake"},{"title":"PostgreSQL To Azure Event Hubs","href":"/usecases/real-time-cdc/postgres-to-azure-eventhubs"},{"title":"PostgreSQL To AWS S3 And Google Cloud Storage","href":"/usecases/real-time-cdc/postgres-to-cloud"}]},{"group":"Streaming Query Replication","pages":[{"title":"Overview","href":"/usecases/streaming-query-replication/overview"},{"title":"PostgreSQL to PostgreSQL","href":"/usecases/streaming-query-replication/postgres-to-postgres"},{"title":"PostgreSQL to BigQuery","href":"/usecases/streaming-query-replication/postgres-to-bigquery"},{"title":"PostgreSQL to S3","href":"/usecases/streaming-query-replication/postgres-to-s3"},{"title":"PostgreSQL to Snowflake","href":"/usecases/streaming-query-replication/postgres-to-snowflake"}]},{"title":"Query Federation via PostgreSQL","href":"/usecases/postgres-compatible-layer-for-bigquery-and-snowflake"}]},{"group":"Benchmarks","pages":[{"title":null,"href":"/benchmarks/benchmarking-Postgres-Replication:-PeerDB-vs-Airbyte"}]},{"group":"Contributing","pages":[{"title":"Running Flow tests","href":"/dev/running-tests"}]},{"group":"Metrics and Tuning","pages":[{"title":"Config Tuning for Change Data Capture (CDC)","href":"/metrics/important_cdc_configs"},{"title":"Native Metrics","href":"/metrics/native-metrics"}]},{"group":"FAQs","pages":[{"title":"Frequently Asked Questions","href":"/faqs/faqs"}]}]},{"anchor":"SQL Reference","icon":"rectangle-terminal","pages":[{"title":"SQL Reference","href":"/sql/reference"}]},{"anchor":"API Reference","icon":"browser","pages":[{"title":"API Reference","href":"/peerdb-api/reference"}]},{"anchor":"Lua Reference","icon":"file-code","pages":[{"title":"Lua Reference","href":"/lua/reference"}]},{"anchor":"GitHub","href":"https://github.com/PeerDB-io/peerdb","icon":"github"},{"anchor":"Changelog","href":"https://github.com/PeerDB-io/peerdb/releases","icon":"list"},{"anchor":"Community","href":"https://slack.peerdb.io","icon":"slack"}]},"title":"CDC Setup from Postgres to ClickHouse - PeerDB Docs: Setup your ETL in minutes with SQL.","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-DYplxqhs.js","DynamicMarkdown-Cc6AuSHS.js","zoom-image-lightbox-BNnMwe0F.js","lightbox-handle-r17bVUz3.js"]}