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 1iL2mQ-0006Bs-Vs for pgsql-general@arkaria.postgresql.org; Thu, 17 Oct 2019 10:13:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iL2mP-0007RD-Am for pgsql-general@arkaria.postgresql.org; Thu, 17 Oct 2019 10:13:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iL2mO-0007R4-TY for pgsql-general@lists.postgresql.org; Thu, 17 Oct 2019 10:13:13 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1iL2mM-0006Lo-1u for pgsql-general@postgresql.org; Thu, 17 Oct 2019 10:13:11 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 1E65517FCCEB3 for ; Thu, 17 Oct 2019 03:13:08 -0700 (MST) Date: Thu, 17 Oct 2019 03:13:08 -0700 (MST) From: PegoraroF10 To: pgsql-general@postgresql.org Message-ID: <1571307188122-0.post@n3.nabble.com> In-Reply-To: <6336a5c2-5289-43a7-d434-15e312ed271d@aklaver.com> References: <1571258838155-0.post@n3.nabble.com> <6336a5c2-5289-43a7-d434-15e312ed271d@aklaver.com> Subject: Re: Changing PK on replicated database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Correct, those records are on replica too. I=C2=B4m 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 wil= l 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 ?=20 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=C2=B4ll get a warning o= n 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.h= tml