PostgreSQL.
When using physical replication, does a given row in a table in the replica database have the same primary key value as its corresponding row in the primary database?
Same question when using logical replication.
Thank you.
-
This site works best with single questions. You can make it into a single question by saying "physical or logical". Otherwise there is a possibility that the question could be closed.Rohit Gupta– Rohit Gupta2024年08月02日 16:56:51 +00:00Commented Aug 2, 2024 at 16:56
1 Answer 1
Both Physical replication
as well as logical replication
the downstream
server i.e, standby
in case of physical replication and subscriber
in logical replication will have the exact values as in the source. In logical replication a table is expected to have primary key
for UPDATE
& DELETE
operation but for physical replication a PK
is not mandatory for such operations.
Additionally physical replication works on whole cluster
while logical replication have selectivity which allows you to choose database/schema/tables
.