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

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Logical replication from 11.x to 12.x and "unique key violations"
Дата
Msg-id 33f03eeb-1904-1f7e-a5d7-5d4c36a652d6@gmx.net
обсуждение исходный текст
Ответ на Logical replication from 11.x to 12.x and "unique key violations"  (Thomas Kellerer <shammat@gmx.net>)
Список pgsql-general
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
statementsto setup the lookup tables. So obviously the initial sync would fail for those tables. When I re-started
replicationI 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




В списке pgsql-general по дате отправления:

Предыдущее
От: "Andrus"
Дата:
Сообщение: How to create function returning numeric from string containing percent character
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: Switching Primary Keys to BigInt