Re: Problem with logical replication - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Problem with logical replication
Date
Msg-id CA+fd4k7BCv-0GAsEU42XxokB+a0wpyQO81HMxr5S0ryFJAWd_g@mail.gmail.com
Whole thread Raw
In response to Re: Problem with logical replication  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Problem with logical replication  (Euler Taveira <euler.taveira@2ndquadrant.com>)
List pgsql-hackers
On Mon, 11 May 2020 at 16:28, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Sun, May 10, 2020 at 07:08:03PM -0300, Euler Taveira wrote:
> > I attached a patch with the described solution. I also included a test that
> > covers this scenario.
>
> -   Assert(RelationGetReplicaIndex(rel) == RelationGetRelid(idxrel));
> +   Assert(GetRelationIdentityOrPK(rel) == RelationGetRelid(idxrel));
>
> Not much a fan of adding a routine to relcache.c to do the work of two
> routines already present, so I think that we had better add an extra
> condition based on RelationGetPrimaryKeyIndex, and give up on
> GetRelationIdentityOrPK() in execReplication.c.

+1

In any case, it seems to me that the comment of
build_replindex_scan_key needs to be updated.

 * This is not generic routine, it expects the idxrel to be replication
 * identity of a rel and meet all limitations associated with that.

For example, we can update the above:

 * This is not generic routine, it expects the idxrel to be replication
 * identity or primary key of a rel and meet all limitations associated
* with that.

Regards,

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



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: refactoring basebackup.c
Next
From: Andy Fan
Date:
Subject: Re: No core file generated after PostgresNode->start