pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Lou Tseng <ltseng@advancedpricing.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Seeded Replication
Date: Wed, 3 Apr 2019 17:10:04 -0700
Message-ID: <5f7d3e5a-9e79-d24b-5ba6-a6c4ebf87b32@aklaver.com> (raw)
In-Reply-To: <DM6PR11MB2939A18E1D2441B4B984165BC4570@DM6PR11MB2939.namprd11.prod.outlook.com>
References: <DM6PR11MB2939A18E1D2441B4B984165BC4570@DM6PR11MB2939.namprd11.prod.outlook.com>

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 <mailto:ltseng@advancedpricing.com>
> <http://www.advancedpricing.com/;
> Advanced Medical Pricing Solutions <http://advancedpricing.com/;
> 35 Technology Parkway South, Suite. 100
> Peachtree Corners, GA 30092
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (6+ messages)  latest in thread

Message-ID: <5f7d3e5a-9e79-d24b-5ba6-a6c4ebf87b32@aklaver.com>
Permalink:  ../5f7d3e5a-9e79-d24b-5ba6-a6c4ebf87b32@aklaver.com/
Also on:    postgresql.org/message-id/5f7d3e5a-9e79-d24b-5ba6-a6c4ebf87b32@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ltseng@advancedpricing.com
  Subject: Re: Seeded Replication
  In-Reply-To: <5f7d3e5a-9e79-d24b-5ba6-a6c4ebf87b32@aklaver.com>
  References: <DM6PR11MB2939A18E1D2441B4B984165BC4570@DM6PR11MB2939.namprd11.prod.outlook.com> <5f7d3e5a-9e79-d24b-5ba6-a6c4ebf87b32@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox