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 1iKrZ1-0001gE-4H for pgsql-general@arkaria.postgresql.org; Wed, 16 Oct 2019 22:14:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iKrYy-00053n-LO for pgsql-general@arkaria.postgresql.org; Wed, 16 Oct 2019 22:14:36 +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 1iKrYy-00053W-B8 for pgsql-general@lists.postgresql.org; Wed, 16 Oct 2019 22:14:36 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iKrYv-0005q1-Kf for pgsql-general@postgresql.org; Wed, 16 Oct 2019 22:14:35 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id AE80B14ED; Wed, 16 Oct 2019 18:14:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 16 Oct 2019 18:14:31 -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=fm1; bh=I zEyiG6zodpFhdui6W1vh3WSPUEVXZG3OhVNTo33TzI=; b=xs2y0HEtEqQg+AQtu La05Zu41USKgzrhGB8Toonffvd3BlIwp59zLY15RPhDKErDfa6v4nzsTIIAXQZWM CNvN+MmHd0yEIJ6eRVfWF4St+YryA7t7ystB1WXc7iW4t5sXpomDgl4BiRRH0HXt qOG9rSl2mxZ1pI3RNio+95OPhkwEtKUPRF5aOv4XxbR5iyTfXnFUQEd6oCS7Sf6V w9XM3juOzkxTm5KFNSuM46Jon1fsXtp9hZFwuTHBClrnwgFq+pA6ddazXfqtqc0b 77ZgyOthgUUdE7Y/CRgUbwDlG6+2kgqYB/tm2U/+G+xwOaIDnXATg5eOQw6+qGtp X2Jqg== 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=fm1; bh=IzEyiG6zodpFhdui6W1vh3WSPUEVXZG3OhVNTo33T zI=; b=K8lTw2SZS5YZrV6D14ebnkqun399Ap1/sQ1bJ7CsK1PpxjwVE0y/apaL8 BP4aUnFY9QYNvK+qMLsvCmRSwUKsh2SvDKR91bZfae+AFwqFbtBPZtNPLt+UdyTf kEBPIR6DBH27VIVOh/PpDDv9465RrZvPOe56OA8yg0sGGFouwZFd7u2MFzwM1gQC VFgL6Yr5vmQjWGL79pQ12tHsJ5qQpZPxIBMVrc50Bhyx+ESYFT5lOQ0jG1MuO7qQ uuXuQ7WUSdd621bqby9PWWlqeeoHnf/bjdkSF1DvJa9lmeMuPqqsHj7+DnSiZSIr YZTF8HxqO0W9I2l22pN3zfL6IkOyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrjeeigddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhoshhtghhrvghsqh hlqdgrrhgthhhivhgvrdhorhhgnecukfhppeehtddrudeljedrkedtrddvnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (50-197-80-2-static.hfc.comcastbusiness.net [50.197.80.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B6C380059; Wed, 16 Oct 2019 18:14:30 -0400 (EDT) Subject: Re: Changing PK on replicated database To: PegoraroF10 , pgsql-general@postgresql.org References: <1571258838155-0.post@n3.nabble.com> From: Adrian Klaver Message-ID: <6336a5c2-5289-43a7-d434-15e312ed271d@aklaver.com> Date: Wed, 16 Oct 2019 15:14:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <1571258838155-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8; 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 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