Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBpxT-00028h-N1 for pgsql-general@arkaria.postgresql.org; Thu, 04 Apr 2019 00:10:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBpxQ-0002iK-98 for pgsql-general@arkaria.postgresql.org; Thu, 04 Apr 2019 00:10:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBpxO-0002f4-K4 for pgsql-general@lists.postgresql.org; Thu, 04 Apr 2019 00:10:16 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBpxJ-0007xe-IN for pgsql-general@postgresql.org; Thu, 04 Apr 2019 00:10:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D83A522078; Wed, 3 Apr 2019 20:10:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 03 Apr 2019 20:10:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=1 QYLRcjOgvsk8IWgI+e1O2NeN+H2cQexouM9xFEwk+E=; b=JG2UDEZuj7S5wDAxR Y9A+9ruJMxrSgNrW8PpLr8IX9vWfYa19R+nvQF6bprIbaWkbUueVG+pSz4hwlceV GHw5QkMMJ82c4Yiy3muE77zdGiyK4L62T047wcErO5nw978oj852jsTs+Hpo1S5r w9QyoJ4ngpCNrRC5d+dXaNLFSMEY+wjEJ5Z/7f0uGIfg1ulX+FymgZLKhTKuim3j p4f3BJjMzCVFcRTd2y1zFnRWiKKS9TMpcldMPaRkDSmOXXfrtZHoWHtZhEr/9YH/ Gisdg7rtgWGGAaVxEv/5k9G7vMKnROhHCU5FQ+yXePiIp+wTC1y64KW8qpFYDEyV S1jZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=1QYLRcjOgvsk8IWgI+e1O2NeN+H2cQexouM9xFEwk +E=; b=xkNjuJ+5dIqi4vXJBiXHEjhl1xEqPaD8gDxX6xAlF9C5Jt5y7WllCJNuq OuhfahsjvPn3IHTPvPDQLQgmAN1NfaUchi4sL/ZQ0hT+eb+gswxEgfNqvKaNX6Jt ZZD0GHFgaQMzDqy/rb6ytWZaXfoXUoXoaCxXIlqcwSoPlo8HAVd82R66qVhP2y8J hkwIRVzmDJjzMGZhfNmMq8WGmBtl36G9DDMqL+y2WtGtnMcXYr+gCeLUweHWoLDB vcuQCHFDmJzGeynhsJZfRDNnJZx6i2W1pQ9xbJx51ZjCrjYXCIWd/lZUXEJC1Spv Yz8o17+2Ev17OZCOG2FkRgTvtSCew== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdeggddvleculddtuddrgedutddrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeeh necuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpeguvghpvghsiidrtghomhdprggu vhgrnhgtvgguphhrihgtihhnghdrtghomhdpphhoshhtghhrvghsqhhlrdhorhhgnecukf hppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhhomheprggu rhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiii gvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id A7175E452F; Wed, 3 Apr 2019 20:10:05 -0400 (EDT) Subject: Re: Seeded Replication To: Lou Tseng , "pgsql-general@postgresql.org" References: From: Adrian Klaver Message-ID: <5f7d3e5a-9e79-d24b-5ba6-a6c4ebf87b32@aklaver.com> Date: Wed, 3 Apr 2019 17:10:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/3/19 4:44 AM, Lou Tseng wrote: > Hi, > > We are working on a project to set up replication from on premises > Postgresql 10.4 to Azure Postgresql services. However, our database is > about 200G and it will take a long time to complete the initial data > copy.  We would like to manually seed the subscriber database with data > dump and then turn on the subscription like depesz showed in this post > https://www.depesz.com/2017/02/07/waiting-for-postgresql-10-logical-replication/ . > It works for the small testing database but when I applied same steps > with entire database, I am getting "ERROR:  duplicate key value violates > unique constraint" errors. Basically postgresql does not recognize the > primary key. Actually it does which why you get the error, which by the way is the same error depesz got in his demo:) From your subsequent post: CREATE SUBSCRIPTION ... WITH (enabled = false) Did the above also have?: https://www.postgresql.org/docs/11/sql-createsubscription.html copy_data = false If not then you would copying over the data again and that would trigger the duplicate key error. > > Any thought / suggestion is helpful! > > Lou Tseng > > ltseng@advancedpricing.com > > Advanced Medical Pricing Solutions > 35 Technology Parkway South, Suite. 100 > Peachtree Corners, GA 30092 > > -- Adrian Klaver adrian.klaver@aklaver.com