Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Jede PostgreSQL-Quelldatenbank greift auf das Feature logische Decodierung zurück. In PostgreSQL wird die logische Decodierung durch Decodieren des Inhalts der Write-Ahead-Log-Dateien (WAL) implementiert. Die WAL-Dateien enthalten Informationen zum Verlauf der Aktivitäten in einer Datenbank. Datastream nutzt diese Dateien, um Datenänderungen abzufragen. Weitere Informationen zur Funktionsweise von Datastream mit WAL-Dateien finden Sie unter Mit WAL-Dateien der PostgreSQL-Datenbank arbeiten.
Publikations- und Replikationsslots
Wenn Sie Ihre PostgreSQL-Quelle konfigurieren, müssen Sie eine Publikation und einen Replikationsslot erstellen.
Eine Publikation ist eine Gruppe von Änderungen, die aus einer Tabelle oder einer Gruppe von Tabellen generiert werden, die Sie mithilfe der logischen Replikation replizieren möchten.
Ein Replikationsslot ist eine PostgreSQL-Funktion, die dafür sorgt, dass ein Stream von Änderungen, die in einer WAL-Logdatei gespeichert sind, in der richtigen Reihenfolge an das Ziel repliziert wird.
Jeder Replikations-Slot streamt eine Folge von Änderungen aus einer einzelnen Datenbank und jede Publikation ist nur in einer Datenbank vorhanden. Das bedeutet, dass Sie einen oder mehrere Streams pro Datenbank mit einem Replikations-Slot pro Stream erstellen müssen. Aus Gründen der Übersichtlichkeit empfiehlt es sich außerdem, den Namen der Publikation an die im Stream ausgewählten Tabellen anzupassen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\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."]]