rtshome / pgrepup

Pgrepup is a tool for upgrading through PostgreSQL major versions using logical replication and pglogical extension
GNU General Public License v3.0
37 stars 9 forks source link

Unable to setup the source node when there are tables without primary keys #4

Closed rtshome closed 7 years ago

rtshome commented 7 years ago

pglogical doesn't correctly allow to add tables without a primary key when replicating both inserts, updates and deletes as it cannot identify the records to modify in the latter two cases.

When creating the replication set, pglogical outputs the following message:

ERROR: table cannot be added to replication set default DETAIL: table does not have PRIMARY KEY and given replication set is configured to replicate UPDATEs and/or DELETEs HINT: Add a PRIMARY KEY to the table

I think we should check for tables missing the primary key (or unique index) already in the check command and give hints to fix the issue