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

From: Avi Weinberg <AviW(at)gilat(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Logical Replication - Different Primary Key on Source Table and Destination Table
Date: 2021-08-05 07:22:31
Message-ID: DB9PR07MB7180BA37AF3D17E57CDEFA36CBF29@DB9PR07MB7180.eurprd07.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I use logical replication to copy data from many source tables to one destination table. On destination table I would like to have primary key composed of the source site ID and row ID. On the source table I only need the primary key to be the row ID since the site ID is always the same per site. Is it permitted to have different primary key on source and destination tables?

Thanks
IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laura Smith 2021-08-05 11:52:19 PostgreSQL Apt Repository instructions need updating
Previous Message Luca Ferrari 2021-08-05 06:07:54 autovacuum worker started without a worker entry