소스 PostgreSQL 데이터베이스에서 가져오는 데이터가 Datastream에서 처리되는 방법
Datastream에서 지원되는 PostgreSQL 데이터베이스 버전
데이터를 대상으로 스트리밍할 수 있도록 소스 PostgreSQL 데이터베이스를 설정하는 방법의 개요
PostgreSQL 데이터베이스를 소스로 사용할 경우의 알려진 제한사항
동작
소스 PostgreSQL 데이터베이스는 논리적 디코딩 기능을 사용합니다. 논리적 디코딩은 데이터베이스에 커밋된 모든 변경사항을 노출하고 출력 플러그인을 사용하여 이러한 변경사항을 사용자 친화적인 형식으로 사용하고 처리할 수 있게 해줍니다. Datastream은 PostgreSQL 10 이상용 표준 PostgreSQL 논리적 디코딩 플러그인인 pgoutput 플러그인을 사용합니다.
특정 PostgreSQL 소스의 모든 스키마 또는 특정 스키마와 스키마의 모든 테이블 또는 특정 테이블을 선택할 수 있습니다.
모든 이전 데이터가 복제됩니다.
지정된 데이터베이스 및 테이블의 삽입, 업데이트, 삭제와 같은 모든 데이터 조작 언어(DML) 변경사항이 복제됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 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."]]