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

Correct, those records are on replica too. I´m just talking about the best
way to update those keys and all their dependent tables.
If I change them first on master they will not be replicated because it will
be an update and their pk will not be found on replica, correct ?
If so, do I need to update manually on replica and later on master ? 
And on replica server, all FK will be updated if I change that PK ? On
replica triggers are not triggered, are foreign key cascade ?
If I do this way, when I change that PK on master I´ll get a warning on
replica server because that PK did not exist anymore ?

The only question is, what are correct steps to do when you need to change a
PK on replicated database, just that.



--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html





view thread (5+ messages)  latest in thread

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