[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-12。"],[[["\u003cp\u003eDatastream leverages PostgreSQL's logical decoding feature, which decodes the Write Ahead Log (WAL) files to query data changes.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring a PostgreSQL source for Datastream requires creating a publication, which is a set of changes from tables to be replicated.\u003c/p\u003e\n"],["\u003cp\u003eA replication slot, a PostgreSQL feature, is also needed to ensure that the stream of changes from a WAL log file is replicated to the destination in the correct order.\u003c/p\u003e\n"],["\u003cp\u003eDatastream supports various PostgreSQL databases, including AlloyDB for PostgreSQL, Amazon Aurora PostgreSQL, Cloud SQL for PostgreSQL, and self-managed PostgreSQL.\u003c/p\u003e\n"],["\u003cp\u003eEach replication slot streams a sequence of changes from a single database, and each publication exists in only one database.\u003c/p\u003e\n"]]],[],null,["# Configure a source PostgreSQL database\n\nEach source PostgreSQL database relies upon its [logical decoding](https://www.postgresql.org/docs/current/logicaldecoding-explanation.html) feature. In PostgreSQL, logical decoding is implemented by decoding the contents of the Write Ahead Log (WAL) files. The WAL files contain information about the history of activity on a database, and Datastream leverages these files to query data changes. For more information about how Datastream works with WAL files, see [Work with PostgreSQL database WAL files](/datastream/docs/work-with-postgresql-database-wal-log-files).\n\nPublication and replication slots\n---------------------------------\n\nWhen you configure your PostgreSQL source, you need to create a publication and a\nreplication slot.\n\nA publication is a set of changes generated from a table, or a group of tables,\nthat you want to replicate using logical replication.\n\nA replication slot is a PostgreSQL feature which ensures that a stream of changes\nstored in a WAL log file is replicated to the destination in the correct order.\n\nEach replication slot streams a sequence of changes from a single database, and each publication exists in only one database. This means that you need to create one or more streams per database, with one replication slot per stream. It's also a good practice to keep the publication name aligned with the tables selected in the stream for clarity.\n\nFor more information, see [Publication](https://www.postgresql.org/docs/current/logical-replication-publication.html#LOGICAL-REPLICATION-PUBLICATION)\nand [Replication slots](https://www.postgresql.org/docs/current/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS)\nin PostgreSQL documentation.\n\nSupported databases\n-------------------\n\nDatastream works with the following types of PostgreSQL databases:\n\n- AlloyDB for PostgreSQL\n- AlloyDB Omni\n- Amazon Aurora PostgreSQL\n- Amazon RDS for PostgreSQL\n- Cloud SQL for PostgreSQL\n- Self-managed PostgreSQL (on-premise or cloud-hosted)\n\nWhat's next\n-----------\n\n- Learn how to configure an [AlloyDB for PostgreSQL](/datastream/docs/configure-alloydb-psql) database to work with Datastream.\n- Learn how to configure [AlloyDB Omni](/datastream/docs/configure-self-managed-psql) to work with Datastream.\n- Learn how to configure an [Amazon Aurora PostgreSQL](/datastream/docs/configure-amazon-aurora-psql) database to work with Datastream.\n- Learn how to configure an [Amazon RDS for PostgreSQL](/datastream/docs/configure-amazon-rds-psql) database to work with Datastream.\n- Learn how to configure a [Cloud SQL for PostgreSQL](/datastream/docs/configure-cloudsql-psql) database to work with Datastream.\n- Learn how to configure a [self-managed PostgreSQL](/datastream/docs/configure-self-managed-psql) database to work with Datastream."]]