Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxaAJ-0003L7-Ia for pgsql-general@arkaria.postgresql.org; Mon, 20 Jul 2020 18:05:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jxa9m-0002Sv-NJ for pgsql-general@arkaria.postgresql.org; Mon, 20 Jul 2020 18:04:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxa9m-0002So-FM for pgsql-general@lists.postgresql.org; Mon, 20 Jul 2020 18:04:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxa9k-0005bq-DY for pgsql-general@lists.postgresql.org; Mon, 20 Jul 2020 18:04:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 06KI4jp5578924; Mon, 20 Jul 2020 14:04:45 -0400 From: Tom Lane To: Adrian Klaver cc: Thomas Kellerer , pgsql-general@lists.postgresql.org Subject: Re: Logical replication from 11.x to 12.x and "unique key violations" In-reply-to: References: <76af9b83-74cc-88b5-23a7-0462774f472d@gmx.net> <578230.1595267248@sss.pgh.pa.us> Comments: In-reply-to Adrian Klaver message dated "Mon, 20 Jul 2020 10:56:59 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <578922.1595268285.1@sss.pgh.pa.us> Date: Mon, 20 Jul 2020 14:04:45 -0400 Message-ID: <578923.1595268285@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver writes: > I'm probably missing something, but would that not result in a 'key not > found' type of error. The OP is seeing "duplicate key value violates > unique constraint xxx_pkey". To me that indicates a doubling up of at > least some of the data replication. [ squint... ] Sorry, I completely misread the error condition. Yeah, duplicate keys does seem odd here. Can you provide a self contained example? regards, tom lane