Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O Datastream oferece suporte à replicação de tabelas particionadas para bancos de dados de origem do PostgreSQL. É possível replicar as tabelas como uma única tabela raiz ou como tabelas particionadas separadas. Se você quiser replicar a tabela raiz e as tabelas particionadas, crie dois fluxos diferentes com duas publicações diferentes.
Replicar como uma única tabela raiz
Para replicar tabelas particionadas usando o esquema da tabela raiz, faça o seguinte:
Use uma publicação com o parâmetro publish_via_partition_root definido como true
ou crie uma nova:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 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)."]]