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 1iyIt1-0003sm-1L for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2020 17:18:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iyIsy-0004tU-L9 for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2020 17:18:16 +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 1iyIsy-0004tN-8W for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2020 17:18:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iyIsr-0002xj-5U for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2020 17:18:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 012HI7Sa002956; Sun, 2 Feb 2020 12:18:08 -0500 From: Tom Lane To: Condor cc: pgsql-general@lists.postgresql.org Subject: Re: How to avoid UPDATE on same data in table ? In-reply-to: <1a25799e60c79c65575f6e6375c96a52@stz-bg.com> References: <1a25799e60c79c65575f6e6375c96a52@stz-bg.com> Comments: In-reply-to Condor message dated "Sun, 02 Feb 2020 11:24:02 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2954.1580663887.1@sss.pgh.pa.us> Date: Sun, 02 Feb 2020 12:18:07 -0500 Message-ID: <2955.1580663887@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Condor writes: > I'm using PostgreSQL 12.1 and trying to avoid update on table when data > is the same. I read somewhere if UPDATE is with the same data SQL server > on system level does not do update on table but don't know if that is > true or not. It is not, at least not for PG (can't say about SQL Server). But see suppress_redundant_updates_trigger here: https://www.postgresql.org/docs/current/functions-trigger.html regards, tom lane