Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Dieser Abschnitt enthält Informationen über:
Das Verhalten von Datastream zur Verarbeitung von Daten, die aus einer PostgreSQL-Quelldatenbank abgerufen werden
Die von Datastream unterstützten Versionen der PostgreSQL-Datenbank
Eine Übersicht über das Einrichten einer PostgreSQL-Quelldatenbank, damit Daten daraus an ein Ziel gestreamt werden können
Bekannte Einschränkungen bei Verwendung der PostgreSQL-Datenbank als Quelle
Verhalten
Die PostgreSQL-Quelldatenbank verwendet die Funktion Logische Decodierung. Die logische Decodierung stellt alle Änderungen bereit, die in der Datenbank verbindlich gemacht wurden, und ermöglicht die Verwendung und Verarbeitung dieser Änderungen in einem nutzerfreundlichen Format mithilfe eines Ausgabe-Plug-ins. Datastream verwendet das pgoutput-Plug-in, das Standard-PostgreSQL-Plug-in für die logische Decodierung für PostgreSQL 10 und höher.
Es können alle Schemas oder bestimmte Schemas einer bestimmten PostgreSQL-Quelle sowie alle Tabellen der Schemas oder bestimmte Tabellen ausgewählt werden.
Alle Verlaufsdaten werden repliziert.
Alle DML-Änderungen (Data Manipulation Language, DML) wie Einfügungen, Aktualisierungen und Löschungen aus den angegebenen Datenbanken und Tabellen werden repliziert.
Es werden nur Änderungen repliziert, für die ein Commit durchgeführt wurde.
Wenn Sie für eine Tabelle eine REPLICA IDENTITY definieren, behandelt Datastream die angegebenen Spalten als Primärschlüssel.
Versionen
Datastream unterstützt PostgreSQL-Version 10 und höher.
Datastream unterstützt die folgenden Typen von PostgreSQL-Datenbanken:
Selbst gehostete PostgreSQL
Cloud SQL for PostgreSQL
AlloyDB for PostgreSQL
AlloyDB Omni
Amazon RDS for PostgreSQL
Amazon Aurora PostgreSQL
Bekannte Einschränkungen
Bekannte Einschränkungen bei Verwendung von Datastream mit einer PostgreSQL-Datenbank als Quelle:
Streams sind auf 10.000 Tabellen beschränkt.
Für Tabellen mit mehr als 500 Millionen Zeilen ist kein Backfill möglich, es sei denn, die folgenden Bedingungen sind erfüllt:
Keine der Spalten des Index darf Nullwerte enthalten.
Alle Spalten des Index sind in aufsteigender oder absteigender Reihenfolge sortiert.
Alle Spalten des Index sind im Stream enthalten.
Tabellen ohne Primärschlüssel müssen eine REPLIKAIDENTITÄT haben. Andernfalls werden nur INSERT-Ereignisse an das Ziel repliziert.
Bei Tabellen mit Primärschlüsseln darf REPLICA IDENTITY nicht auf FULL oder NOTHING festgelegt sein. Es muss auf DEFAULT festgelegt sein.
Datastream kann nicht aus einer Lesereplikate-Instanz repliziert werden, da PostgreSQL die logische Decodierung in Lesereplikaten nicht unterstützt.
Nicht alle Änderungen am Quellschema können automatisch erkannt werden. Dies kann zu Datenbeschädigungen führen. Die folgenden Schemaänderungen können zu Datenbeschädigungen oder Fehlern bei der nachgelagerten Verarbeitung der Ereignisse führen:
Spalten entfernen
Spalten in der Mitte einer Tabelle einfügen
Datentyp einer Spalte ändern.
Spalten neu anordnen
Tabellen löschen (relevant, wenn dieselbe Tabelle anschließend mit neuen Daten neu erstellt wird)
Datastream unterstützt keine Spalten der Datentypen geometric.
Datastream unterstützt keine Spalten der Datentypen range.
Datastream unterstützt keine Arrays mit nicht unterstützten Datentypen, Arrays mit nutzerdefinierten Datentypen (einschließlich ENUM) oder Arrays mit den Datentypen DATE, TIMESTAMP oder TIMESTAMP WITH TIME ZONE. Solche Spalten werden ignoriert.
Datastream unterstützt nicht die Replikation von UPDATE-Ereignissen für Zeilen, die TOAST-Werte in Spalten enthalten, die Teil der Replikationsidentität der Tabelle sind. Solche Ereignisse werden verworfen.
Datastream unterstützt keine Replikation von Zeilen, die JSON- oder JSONB-Werte mit mehr als 2.950 verschachtelten Objekten enthalten. Ereignisse mit solchen JSON- oder JSONB-Werten werden nicht in die Zieldatenbank repliziert.
Datastream unterstützt keine Replikation von Zeilen, die NaN-Werte in NUMERIC (precision, scale)-Spalten enthalten. Die Werte in solchen Spalten werden durch NULL-Werte ersetzt.
Datastream unterstützt keine Replikation von Spalten vom Datentyp hstore. Die Werte in solchen Spalten werden durch NULL-Werte ersetzt.
Datastream unterstützt keine Replikation von Nicht-ASCII-Einträgen aus einer mit SQL_ASCII codierten Quelldatenbank. Solche Einträge werden verworfen.
Datastream unterstützt keine Replikation von Tabellen mit definierten Richtlinien für die Sicherheit auf Zeilenebene.
Informationen dazu, wie Sie diese Einschränkung umgehen, finden Sie unter Verhalten und Einschränkungen von PostgreSQL-Quellen.
Wenn ein Upgrade auf eine neue PostgreSQL-Hauptversion durchgeführt wird, funktioniert Datastream möglicherweise nicht mehr oder es werden keine neuen Ereignisse erfasst. Wir empfehlen, die Replikationsslots vor dem Upgrade zu löschen, dann die Datenbank zu aktualisieren und die Replikationsslots anschließend neu zu erstellen. Wenn die Streams fehlschlagen, stellen Sie sie durch Angabe des neuen Namens des Replikationsslots wieder her und führen Sie ein Backfill durch, wenn Datenkonsistenz erforderlich ist.
[[["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 uses PostgreSQL's logical decoding feature and the \u003ccode\u003epgoutput\u003c/code\u003e plugin to replicate committed data changes, including historical data and DML operations like inserts, updates, and deletes, from the source database.\u003c/p\u003e\n"],["\u003cp\u003eDatastream supports PostgreSQL version 10 and later, along with various PostgreSQL database types such as self-hosted, Cloud SQL, AlloyDB, Amazon RDS, and Amazon Aurora.\u003c/p\u003e\n"],["\u003cp\u003eThere is a limitation of 10,000 tables per stream, and tables with over 500 million rows have specific backfill requirements, such as having a unique B-tree index with non-nullable columns.\u003c/p\u003e\n"],["\u003cp\u003eTables without primary keys must have a \u003ccode\u003eREPLICA IDENTITY\u003c/code\u003e defined; otherwise, only \u003ccode\u003eINSERT\u003c/code\u003e events are replicated, and Datastream cannot replicate from a read replica instance.\u003c/p\u003e\n"],["\u003cp\u003eSpecific schema changes like dropping columns or changing data types, as well as unsupported data types like geometric or range data types, can cause data corruption or failure, and certain data like \u003ccode\u003eJSON\u003c/code\u003e or \u003ccode\u003eJSONB\u003c/code\u003e values with excessive nesting also have replication limitations.\u003c/p\u003e\n"]]],[],null,["# Source PostgreSQL database\n\nThis section contains information about:\n\n- The behavior of how Datastream handles data that's being pulled from a source PostgreSQL database\n- The versions of PostgreSQL database that Datastream supports\n- An overview of how to setup a source PostgreSQL database so that data can be streamed from it to a destination\n- Known limitations for using PostgreSQL database as a source\n\nBehavior\n--------\n\nThe source PostgreSQL database relies upon its [logical decoding](https://www.postgresql.org/docs/current/logicaldecoding-explanation.html) feature. Logical decoding exposes all changes committed to the database and allows consuming and processing these changes in a user-friendly format using an output plugin. Datastream uses the `pgoutput` plugin, which is the standard PostgreSQL logical decoding plugin for PostgreSQL 10 and later.\n\n- All schemas or specific schemas from a given PostgreSQL source, as well as all tables from the schema or specific tables, can be selected.\n- All historical data is replicated.\n- All data manipulation language (DML) changes, such as inserts, updates, and deletes from the specified databases and tables, are replicated.\n- Only committed changes are replicated.\n- If you define a [REPLICA IDENTITY](https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-REPLICA-IDENTITY) on a table, Datastream treats the specified columns as primary keys.\n\nVersions\n--------\n\nDatastream supports PostgreSQL version 10 and later.\n\nDatastream supports the following types of PostgreSQL database:\n\n- Self-hosted PostgreSQL\n- Cloud SQL for PostgreSQL\n- AlloyDB for PostgreSQL\n- AlloyDB Omni\n- Amazon RDS for PostgreSQL\n- Amazon Aurora PostgreSQL\n\nKnown limitations\n-----------------\n\n| **Note:** This section describes limitations for using Datastream with a PostgreSQL database as a source. In addition to these limitations, you need to familiarize yourself with PostgreSQL logical replication limitations, because they also affect how Datastream streams data from a PostgreSQL source. To learn about limitations of PostgreSQL logical replication, see [logical replication restrictions](https://www.postgresql.org/docs/10/logical-replication-restrictions.html).\n\nKnown limitations for using Datastream with a PostgreSQL database as a source include:\n\n- Streams are limited to 10,000 tables.\n- A table that has more than 500 million rows can't be backfilled unless the following conditions are met:\n 1. The table has a unique B-tree index.\n 2. The index doesn't include columns of the following types: `DOUBLE`, `FLOAT`, `MONEY`, `REAL`, `JSON`, `JSONB`, `BYTEA`, `TXID`, `XML`, [composite data types](https://www.postgresql.org/docs/current/rowtypes.html#ROWTYPES) or [geometric data types](https://www.postgresql.org/docs/current/datatype-geometric.html).\n 3. None of the columns of the index are nullable.\n 4. All columns of the index are in ascending order, or all columns of the index are in descending order.\n 5. All columns of the index are included in the stream.\n- Tables without primary keys must have a [REPLICA IDENTITY](https://www.postgresql.org/docs/current/sql-altertable.html#SQL-CREATETABLE-REPLICA-IDENTITY). Otherwise, only `INSERT` events are replicated to the destination.\n- Tables with primary keys can't have the [REPLICA IDENTITY](https://www.postgresql.org/docs/current/sql-altertable.html#SQL-CREATETABLE-REPLICA-IDENTITY) set to `FULL` or `NOTHING`. It has to be set to `DEFAULT`.\n- Datastream can't replicate from a read replica instance, because PostgreSQL doesn't support logical decoding in read replicas.\n- Not all changes to the source schema can be detected automatically, in which case data corruption may occur. The following schema changes may cause data corruption or failure to process the events downstream:\n - Dropping columns.\n - Adding columns to the middle of a table.\n - Changing the data type of a column.\n - Reordering columns.\n - Dropping tables (relevant if the same table is then recreated with new data added).\n- Datastream doesn't support columns of the [`geometric`](https://www.postgresql.org/docs/current/datatype-geometric.html) data types.\n- Datastream doesn't support columns of the [`range`](https://www.postgresql.org/docs/current/rangetypes.html) data types.\n- Datastream doesn't support arrays of unsupported data types, arrays of [user-defined](https://www.postgresql.org/docs/15/xtypes.html) data types (including `ENUM`) or arrays of `DATE`, `TIMESTAMP` or `TIMESTAMP WITH TIME ZONE` data types. Such columns are ignored.\n- Datastream doesn't support replicating `UPDATE` events for rows which include [`TOAST`](https://www.postgresql.org/docs/current/storage-toast.html) values in columns that are part of the table's replica identity. Such events are discarded.\n- Datastream doesn't support replicating rows which include `JSON` or `JSONB` values with more than 2950 nested objects. Events containing such `JSON` or `JSONB` values aren't replicated to the destination database.\n- Datastream doesn't support replicating rows which include `NaN` values in `NUMERIC (precision, scale)` columns. The values in such columns are replaced with `NULL` values.\n- Datastream doesn't support replicating columns of the [hstore](https://www.postgresql.org/docs/current/hstore.html) data type. The values in such columns are replaced with `NULL` values.\n- Datastream doesn't support replicating non-ASCII records from a SQL_ASCII encoded source database. Such records are discarded.\n- Datastream doesn't support replicating tables with Row-Level Security (RLS) policies defined. For information about how to bypass this limitation, see [PostgreSQL source behavior and limitations](/datastream/docs/faq#postgresql-source).\n- Datastream doesn't capture changes made to [generated columns](https://www.postgresql.org/docs/current/ddl-generated-columns.html).\n- Datastream might stop working or not capture any new events when a PostgreSQL major version upgrade is performed on the database. We suggest you to drop the replication slots before the upgrade, then upgrade the database, and then recreate the replication slots. If the streams fail, recover the stream by specifying the new replication slot name, and perform a backfill if data consistency is required.\n\nWhat's next\n-----------\n\n- Learn how to [configure a PostgreSQL source](/datastream/docs/configure-your-source-postgresql-database) for use with Datastream."]]