Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Chaque base de données source PostgreSQL s'appuie sur sa fonctionnalité de décodage logique. Dans PostgreSQL, le décodage logique est implémenté en décodant le contenu des fichiers WAL (Write Ahead Log). Les fichiers WAL contiennent des informations sur l'historique d'activité d'une base de données. Datastream utilise ces fichiers pour interroger les modifications de données. Pour en savoir plus sur le fonctionnement de Datastream avec les fichiers WAL, consultez Utiliser les fichiers WAL de la base de données PostgreSQL.
Emplacements de publication et de réplication
Lorsque vous configurez votre source PostgreSQL, vous devez créer une publication et un emplacement de réplication.
Une publication est un ensemble de modifications générées à partir d'une table ou d'un groupe de tables que vous souhaitez répliquer à l'aide de la réplication logique.
Un emplacement de réplication est une fonctionnalité PostgreSQL qui garantit qu'un flux de modifications stockées dans un fichier journal WAL est répliqué vers la destination dans le bon ordre.
Chaque emplacement de réplication diffuse une séquence de modifications à partir d'une seule base de données, et chaque publication n'existe que dans une seule base de données. Cela signifie que vous devez créer un ou plusieurs flux par base de données, avec un emplacement de réplication par flux. Pour plus de clarté, il est également recommandé de faire correspondre le nom de la publication aux tables sélectionnées dans le flux.
Datastream fonctionne avec les types de bases de données PostgreSQL suivants :
AlloyDB pour PostgreSQL
AlloyDB Omni
Amazon Aurora PostgreSQL
Amazon RDS pour PostgreSQL
Cloud SQL pour PostgreSQL
PostgreSQL autogéré (sur site ou hébergé dans le cloud)
Étapes suivantes
Découvrez comment configurer une base de données AlloyDB pour PostgreSQL afin qu'elle fonctionne avec Datastream.
Découvrez comment configurer AlloyDB Omni pour qu'il fonctionne avec Datastream.
Découvrez comment configurer une base de données Amazon Aurora PostgreSQL pour qu'elle fonctionne avec Datastream.
Découvrez comment configurer une base de données Amazon RDS pour PostgreSQL afin qu'elle fonctionne avec Datastream.
Découvrez comment configurer une base de données Cloud SQL pour PostgreSQL afin qu'elle fonctionne avec Datastream.
Découvrez comment configurer une base de données PostgreSQL autogérée pour qu'elle fonctionne avec Datastream.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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."]]