Re: adding partitioned tables to publications

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding partitioned tables to publications
Date: 2020-01-08 10:54:52
Message-ID: 825b31ea-ad9f-21d1-29b6-2a494513458d@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-01-07 06:01, Amit Langote wrote:
> On Mon, Jan 6, 2020 at 8:25 PM Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com> wrote:
>> Hi Amit,
>>
>> I went through this patch set once again today and here are my two cents.
>
> Thanks Rafia.
>
> Rebased and updated to address your comments.

Looking through 0001, I think perhaps there is a better way to structure
some of the API changes.

Instead of passing the root_target_rel to CheckValidResultRel() and
CheckCmdReplicaIdentity(), which we only need to check the publication
actions of the root table, how about changing
GetRelationPublicationActions() to automatically include the publication
information of the root table. Then we have that information in the
relcache once and don't need to check the base table and the partition
root separately at each call site (of which there is only one right
now). (Would that work correctly with relcache invalidation?)

Similarly, couldn't GetRelationPublications() just automatically take
partitioning into account? We don't need the separation between
GetRelationPublications() and GetRelationAncestorPublications(). This
would also avoid errors of omission, for example the
GetRelationPublications() call in ATPrepChangePersistence() doesn't take
GetRelationAncestorPublications() into account.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-01-08 10:57:13 Re: adding partitioned tables to publications
Previous Message Heikki Linnakangas 2020-01-08 10:38:18 Re: Memory-Bounded Hash Aggregation