Re: adding partitioned tables to publications

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding partitioned tables to publications
Date: 2020-04-07 09:01:02
Message-ID: 64a2c1c7-3887-787b-e43b-ac15112bda82@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-04-07 08:44, Amit Langote wrote:
> I updated the patch to make the following changes:
>
> * Rewrote the tests to match in style with those committed yesterday
> * Renamed all variables that had pubasroot in it to have pubviaroot
> instead to match the publication parameter
> * Updated pg_publication catalog documentation

Thanks. I have some further questions:

The change in nodeModifyTable.c to add CheckValidResultRel() is unclear.
It doesn't seem to do anything, and it's not clear how it's related to
this patch.

The changes in GetRelationPublications() are confusing to me:

+ if (published_rels)
+ {
+ num = list_length(result);
+ for (i = 0; i < num; i++)
+ *published_rels = lappend_oid(*published_rels, relid);
+ }

This adds relid to the output list "num" times, where num is the number
of publications found. Shouldn't "i" be used in the loop somehow?
Similarly later in the function.

The descriptions of the new fields in RelationSyncEntry don't seem to
match the code accurately, or at least it's confusing.
replicate_as_relid is always filled in with an ancestor, even if
pubviaroot is not set.

I think the pubviaroot field is actually not necessary. We only need
replicate_as_relid.

There is a markup typo in logical-replication.sgml:

<xref linkend=="sql-createpublication"/>

In pg_dump, you missed updating a branch for an older version. See
attached patch.

Also attached a patch to rephrase the psql output a bit to make it not
so long.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-fixup-Allow-publishing-partition-changes-via-ancesto.patch text/plain 1.3 KB
0002-fixup-Allow-publishing-partition-changes-via-ancesto.patch text/plain 11.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Banck 2020-04-07 09:02:23 Re: [patch] Fix pg_checksums to allow checking of offline base backup directories
Previous Message Nicola Contu 2020-04-07 08:58:19 Re: EINTR while resizing dsm segment.