Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSJAt-0060bY-4E for pgsql-admin@arkaria.postgresql.org; Thu, 19 Jun 2025 17:35:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uSJAr-00DI2f-7F for pgsql-admin@arkaria.postgresql.org; Thu, 19 Jun 2025 17:35:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSJAq-00DI2X-Sr for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:35:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uSJAp-002vWh-22 for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:35:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 55JHZbUv1461471; Thu, 19 Jun 2025 13:35:37 -0400 From: Tom Lane To: Scott Ribe cc: Pgsql-admin Subject: Re: update behavior In-reply-to: <75F792AF-58DF-4559-A2E8-C89060D1E94E@elevated-dev.com> References: <75F792AF-58DF-4559-A2E8-C89060D1E94E@elevated-dev.com> Comments: In-reply-to Scott Ribe message dated "Thu, 19 Jun 2025 11:23:58 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1461469.1750354537.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 19 Jun 2025 13:35:37 -0400 Message-ID: <1461470.1750354537@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Scott Ribe writes: > I believe that if I UPDATE a row with the same values that it already ha= s, this still dirties pages, writes the row, generates a WAL entry. There = is no shortcut in the processing that's "hey, there's not really a change = here, we'll just leave storage alone". > Is this correct? It is. We do offer a trigger you can add to suppress zero-change updates [1], but that's not the default behavior. We judged that checking for that would add more cycles than it removes, for most applications most of the time. regards, tom lane [1] https://www.postgresql.org/docs/current/functions-trigger.html