pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: PegoraroF10 <marcos@f10.com.br>
To: pgsql-general@postgresql.org
Subject: Re: Changing PK on replicated database
Date: Wed, 16 Oct 2019 15:14:29 -0700
Message-ID: <6336a5c2-5289-43a7-d434-15e312ed271d@aklaver.com> (raw)
In-Reply-To: <1571258838155-0.post@n3.nabble.com>
References: <1571258838155-0.post@n3.nabble.com>

On 10/16/19 1:47 PM, PegoraroF10 wrote:
> I have replication using Publication/Subscription and configured with REPLICA
> IDENTITY DEFAULT, so it uses PK values to do the replication. Then, I´ve
> imported data in a new schema and that has several tables with a record with
> its PK = 0. Replication works but my application doesn´t because it needs to
> see pk values > 0.
> 
> So, I have to change those records with 0 on their pk to any value, what is
> the best way to do that ?
> If i just change pk valued on master how will the data of that record be
> replicated ?
> That record will be sent to replica as update but that PK doesn´t exist on
> replica server, so ...

I'm not following. You said above the replication worked with the 
records where PK = 0, it was your application that could not find them. 
If that is true then the records should be on the replica server, 
correct? In that case it would just be an update.
> 
> Or do I need to update them manually on Master and Replicated servers ?
> 
> I didn´t find any info about this on Docs and because that I´m posting about
> this.
> 
> 
> 
> --
> Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (5+ messages)  latest in thread

Message-ID: <6336a5c2-5289-43a7-d434-15e312ed271d@aklaver.com>
Permalink:  ../6336a5c2-5289-43a7-d434-15e312ed271d@aklaver.com/
Also on:    postgresql.org/message-id/6336a5c2-5289-43a7-d434-15e312ed271d@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, marcos@f10.com.br
  Subject: Re: Changing PK on replicated database
  In-Reply-To: <6336a5c2-5289-43a7-d434-15e312ed271d@aklaver.com>
  References: <1571258838155-0.post@n3.nabble.com> <6336a5c2-5289-43a7-d434-15e312ed271d@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