Datastream은 PostgreSQL 소스 데이터베이스에 대해 파티션을 나눈 테이블의 복제를 지원합니다. 테이블을 단일 루트 테이블로 복제하거나 별도의 파티션을 나눈 테이블로 복제할 수 있습니다. 루트 테이블과 파티션을 나눈 테이블을 모두 복제하려면 서로 다른 두 개의 게시를 사용하여 서로 다른 스트림 두 개를 만들어야 합니다.
단일 루트 테이블로 복제
루트 테이블의 스키마를 사용하여 파티션을 나눈 테이블을 복제하려면 다음 안내를 따르세요.
publish_via_partition_root 매개변수가 true로 설정된 게시를 사용하거나 새 게시를 만듭니다.
[[["이해하기 쉬움","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-08-07(UTC)"],[[["\u003cp\u003eDatastream enables the replication of partitioned tables from PostgreSQL databases, offering the flexibility to replicate them as a unified root table or as individual, separate tables.\u003c/p\u003e\n"],["\u003cp\u003eTo replicate partitioned tables as a single root table, use a publication with the \u003ccode\u003epublish_via_partition_root\u003c/code\u003e parameter set to \u003ccode\u003etrue\u003c/code\u003e, and in stream creation select only the root table, excluding the partitioned tables.\u003c/p\u003e\n"],["\u003cp\u003eTo replicate partitioned tables as separate tables, utilize a publication with the \u003ccode\u003epublish_via_partition_root\u003c/code\u003e parameter set to \u003ccode\u003efalse\u003c/code\u003e, and during stream creation, choose only the partitioned tables, excluding the root table.\u003c/p\u003e\n"],["\u003cp\u003eChanging the \u003ccode\u003epublish_via_partition_root\u003c/code\u003e parameter in an existing stream is not allowed, causing permanent stream failure.\u003c/p\u003e\n"]]],[],null,["# Work with PostgreSQL partitioned tables\n\nDatastream supports replicating partitioned tables for PostgreSQL source\ndatabases. You can replicate the tables as a single root table or as separate\npartitioned tables. If you want to replicate both the root table and the partitioned\ntables, you must create two different streams, with two different publications.\n\nReplicate as a single root table\n--------------------------------\n\nTo replicate partitioned tables using the schema of the root table, do the\nfollowing:\n\n1. Use a publication with the `publish_via_partition_root` parameter set to `true`\n or create a new one:\n\n CREATE PUBLICATION \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePUBLICATION_NAME\u003c/span\u003e\u003c/var\u003e FOR TABLE\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eSCHEMA1\u003c/span\u003e\u003cspan class=\"devsite-syntax-p\"\u003e.\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003eTABLE1\u003c/span\u003e\u003c/var\u003e, \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eSCHEMA2\u003c/span\u003e\u003cspan class=\"devsite-syntax-p\"\u003e.\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003eTABLE2\u003c/span\u003e\u003c/var\u003e WITH (publish_via_partition_root = true);\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePUBLICATION_NAME\u003c/var\u003e: The name of the publication.\n - \u003cvar translate=\"no\"\u003eSCHEMA(n)\u003c/var\u003e: The name of the schema that contains the table.\n - \u003cvar translate=\"no\"\u003eTABLE(n)\u003c/var\u003e: The name of the table for which you create the publication.\n\n | **Note:** Changing the value of the `publish_via_partition_root` parameter in a publication that's already used in a stream isn't supported and causes the stream to fail permanently.\n\n For more information about creating a publication, see\n [Configure a source PostgreSQL database](/datastream/docs/configure-your-source-postgresql-database).\n2. Complete the following in the **Configure source** step when you create your\n stream in Google Cloud:\n\n 1. From the **Objects to include** list, select **Specific schemas and\n tables**.\n 2. Select only the root table and make sure that the partitioned tables aren't selected.\n\n For information about creating a stream, see [Create a stream](/datastream/docs/create-a-stream).\n\nReplicate as separate partitioned tables\n----------------------------------------\n\nTo replicate partitioned tables as separate tables, do the following:\n\n1. Use a publication with the `publish_via_partition_root` parameter set to\n `false` or create a new one. `false` is the default setting for the parameter.\n\n | **Note:** Changing the value of the `publish_via_partition_root` parameter in a publication that's already used in a stream isn't supported and causes the stream to fail permanently.\n\n For more information about creating a publication, see\n [Configure a source PostgreSQL database](/datastream/docs/configure-your-source-postgresql-database).\n2. When you create your stream in Google Cloud, in the **Configure source** step,\n do the following:\n\n 1. From the **Objects to include** list, select **Specific schemas and\n tables**.\n 2. Select all partitioned tables and make sure that the root table isn't selected.\n\n For information about creating a stream, see [Create a stream](/datastream/docs/create-a-stream).\n\nWhat's next\n-----------\n\n- Learn more about [PostgreSQL as a source](/datastream/docs/sources-postgresql).\n- Learn more about [configuring a source PostgreSQL database](/datastream/docs/configure-your-source-postgresql-database)."]]