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 1uSJ7x-00602c-Ny for pgsql-admin@arkaria.postgresql.org; Thu, 19 Jun 2025 17:32:41 +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 1uSJ7v-00DB0g-St for pgsql-admin@arkaria.postgresql.org; Thu, 19 Jun 2025 17:32:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSJ7v-00DB0Y-Eu for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:32:40 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uSJ7t-002z4Q-2C for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:32:39 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-606668f8d51so597473eaf.0 for ; Thu, 19 Jun 2025 10:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750354355; x=1750959155; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=g9Tsw1UXRwsye6eLsI7N1MPIVAqsPR9DM7maiPzMVQQ=; b=JxEsNbidAVzN/F0pXVeNgjJdZr1dh53WpRAQu9vKICwYO9BF8Ng72HN2MYhcgLLqb1 cc//fSTzfk/i7Szbh2wFSdHxnFs02ehqNLFAe8gU0GU2zQajlkAkUmUWW3dU8c47F7IY uMKJOM3cVLYOT/LZvc6JAcHlJLojzxbbr/L6LemvAqYSG8KL3oGxVft3Nb5osnoSj/qo 6/x8WRX26Mj6Ph6/hhDAh0gFh5SSnLweKztIdMJ6fkjuGC36S83JuV33SVzszbrq2m3y DiR/2/QSNymb/HV/47HhcXIhCCowmVZ20h3UP5DCzIUJf7qSIDH0bc+xH3fWIUOzK44e WVXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750354355; x=1750959155; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=g9Tsw1UXRwsye6eLsI7N1MPIVAqsPR9DM7maiPzMVQQ=; b=I0Mb2oghphoymHxDscBdxY0bF9Yyk0ChiuA9zejbAf2/PXzF4LmUYiFwW9zEgDx/EK zfCzuMfIE4vH32GntDi06/cyXGyUUg+SD42HlrwQ/s9l9N0f6iIjhmvbJq5SMwxMeql4 fpgYc4i0DGIzh/rUUkx/C7YT99ES7Y8mGvx+++hSmY/6M6tguOSYTmSV8WIABuVG8/c+ 13R6NLYIMZVDq8gfZKyuLCIj++rYY7VeS5uG6KyAJlGogN2gC4rAFCREMuKL7jJSEZa4 ZlDQCoyT7WrgSWnWROFPp4yK6xuy1OUsh7XedwBl8YWBs8tI3FlZxGUZGQT1OMRhonVq ukSw== X-Gm-Message-State: AOJu0YxWPcWjiPS2YJRntuEAbEBUozlXnezd4V4FkeIkMJgF2KNF07HS 94S3FQo4IVUty49A7RFRxBZUT3/kOIvxaaMVVx21VgmMOw26TndfDmRgbdlm0iNUmRAa0wJk0yk /l7xL9CBS8fjcPgtyWBnkYFAEf8b2wDXdfi0h/aM= X-Gm-Gg: ASbGncsgHqvUiWMjN1uNNjWURAalIYjYIVCPzyCYL3/r7Nbd6MakSHkc+25eG4OZL7t CjlfmqVheD+hYWK6CgULp6sFd/ag+wRVImi8uVTWmyE7w/Ng0qGN7qeR9nmO5VHrURDomXTC7jy a9SefX4NiIXq5WlRj71+m3QBuHKlIe+h+F6KJr6dAyOH8uNBKjFLwl7S8Vm/et9zFBR6Vjaz3U2 Uga X-Google-Smtp-Source: AGHT+IHezH4Gtvq6nNgfDQKtse838YHGSgnjjGqlxZOVj9ugNSSRF4X/dYY7anbucaMgG2YlxlOvIUb/zoofcdcdOyQ= X-Received: by 2002:a05:6820:2089:b0:609:f8f1:ce61 with SMTP id 006d021491bc7-6114ea7afd9mr2658857eaf.4.1750354354927; Thu, 19 Jun 2025 10:32:34 -0700 (PDT) MIME-Version: 1.0 References: <75F792AF-58DF-4559-A2E8-C89060D1E94E@elevated-dev.com> In-Reply-To: <75F792AF-58DF-4559-A2E8-C89060D1E94E@elevated-dev.com> From: "David G. Johnston" Date: Thu, 19 Jun 2025 10:31:59 -0700 X-Gm-Features: AX0GCFtkcSjnw7ExxC6a9TTgX3TdLg_BrYf0ZHs0RVE0NBxrbTNhn5brpO5MOGQ Message-ID: Subject: Re: update behavior To: Scott Ribe Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="0000000000008e7c970637f021d0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008e7c970637f021d0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 19, 2025 at 10:24=E2=80=AFAM Scott Ribe wrote: > I believe that if I UPDATE a row with the same values that it already has= , > 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? > > Correct. You need a trigger to prevent the update. There is one provided: suppress_redundant_updates_trigger() https://www.postgresql.org/docs/17/functions-trigger.html David J. --0000000000008e7c970637f021d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jun 19, 2025 at 10:24=E2=80=AFAM Scott Ribe <scott_ribe@elevated-dev.com> wrote:
I believe that if I = UPDATE a row with the same values that it already has, this still dirties p= ages, writes the row, generates a WAL entry. There is no shortcut in the pr= ocessing that's "hey, there's not really a change here, we'= ;ll just leave storage alone".

Is this correct?


Correct.=C2=A0 You n= eed a trigger to prevent the update.=C2=A0 There is one provided: suppress_= redundant_updates_trigger()


David J.

--0000000000008e7c970637f021d0--