Re: Logical Replication - Different Primary Key on Source Table and Destination Table

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Avi Weinberg <AviW(at)gilat(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical Replication - Different Primary Key on Source Table and Destination Table
Date: 2021-08-05 15:42:27
Message-ID: CAKFQuwYKqk9W_M1L8HsJuV7J4_OYLXcU2WMFxjovTVkE50_NXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 5, 2021 at 12:22 AM Avi Weinberg <AviW(at)gilat(dot)com> wrote:

> Is it permitted to have different primary key on source and destination
> tables?
>

Sure, but you are still going to want a unique index on the source table
that includes the site ID to act as a replica identity. Which of the two
unique indexes is "primary" is largely immaterial.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vijaykumar Jain 2021-08-05 16:26:52 Re: autovacuum worker started without a worker entry
Previous Message Laura Smith 2021-08-05 11:52:19 PostgreSQL Apt Repository instructions need updating