Re: adding partitioned tables to publications
amit <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Rafia Sabih <rafia.pghackers@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-12-06T07:48:42Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix RELCACHE_FORCE_RELEASE issue
- 12fb189bfeaf 13.0 landed
-
Allow publishing partition changes via ancestors
- 83fd4532a721 13.0 landed
-
Add logical replication support to replicate into partitioned tables
- f1ac27bfda6c 13.0 landed
-
Refactor code to look up local replication tuple
- d8653f468789 13.0 landed
-
Some refactoring of logical/worker.c
- 97ee604d9bce 13.0 landed
-
Prepare to support non-tables in publications
- c314c147c056 13.0 landed
-
Support adding partitioned tables to publication
- 17b9e7f9fe23 13.0 landed
Attachments
- v6-0002-Add-publish_using_root_schema-parameter-for-publi.patch (application/octet-stream) patch v6-0002
- v6-0001-Support-adding-partitioned-tables-to-publication.patch (application/octet-stream) patch v6-0001
- v6-0004-Publish-partitioned-table-inserts-as-its-own.patch (application/octet-stream) patch v6-0004
- v6-0003-Some-refactoring-of-logical-worker.c.patch (application/octet-stream) patch v6-0003
On Mon, Nov 25, 2019 at 6:37 PM Amit Langote <amitlangote09@gmail.com> wrote: > OK, let's make whether to publish with root or leaf schema an option, > with the latter being the default. I will see about updating the > patch that way. Here are the updated patches. 0001: Adding a partitioned table to a publication implicitly adds all its partitions. The receiving side must have tables matching the published partitions, which is typically the case, because the same partition tree is defined on both nodes. 0002: Add a new Boolean publication parameter 'publish_using_root_schema'. If true, a partitioned table's partitions are not exposed to the subscriber, that is, changes of its partitions are published as its own. This allows to replicate partitioned table changes to a non-partitioned table (seldom useful) or to a partitioned table that has different set of partitions than on the publisher (a reasonable use case). This patch only adds the parameter and doesn't implement any of that behavior. 0003: A refactoring patch for worker.c to allow handling partitioned tables as targets of logical of replication commands a bit easier. 0004: This implements the 'publish_using_root_schema = true' behavior described above. (An unintended benefit of making partitioned tables an accepted relation type in worker.c is that it allows partitions on subscriber to be sub-partitioned even if they are not on the publisher, that is, when replicating partition-to-partition!) Thanks, Amit