Search Postgresql Archives

Re: Logical replication from 11.x to 12.x and "unique key violations"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thomas Kellerer schrieb am 13.07.2020 um 11:52:
> If I create the publication with all needed tables (about 50) at
> once, I get "duplicate key value violates unique constraint xxx_pkey"
> errors during the initial replication (when creating the
> subscription).

Turns out the problem was - once again - between the keyboard and the chair.

The script/job to initialize the database structure (to make sure primary and secondary are in sync) also includes statements to setup the lookup tables. So obviously the initial sync would fail for those tables. When I re-started replication I truncated all tables without re-running the setup script.

I wonder if it makes sense to add an "on conflict (pk) do nothing" option to the logical replication features ;)

Sorry for the noise
Thomas







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux