When you perform logical replication with Mastodon, you need to set the REPLICA IDENTITY for tables that do not have an ID set.
ALTER TABLE accounts_tags REPLICA IDENTITY FULL;
ALTER TABLE statuses_tags REPLICA IDENTITY FULL;
ALTER TABLE preview_cards_statuses REPLICA IDENTITY FULL;
@noellabo I wonder if not giving those tables a pkey was a mistake on my part. I wanted to save space since they are join tables...
Also, logical replication does not replicate the sequence. If you add a record to a new database without changing its ID, it will be set to the primary key already in use, and the addition will fail.
To avoid duplication, reset the sequence to the maximum value of the current primary key. The following articles may be helpful
https://qiita.com/unarist/items/1ef370933d5745d9c336