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 1uSJXJ-00657h-0x for pgsql-admin@arkaria.postgresql.org; Thu, 19 Jun 2025 17:58:53 +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 1uSJXG-00DdAz-C9 for pgsql-admin@arkaria.postgresql.org; Thu, 19 Jun 2025 17:58:51 +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 1uSJXG-00DdAh-11 for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:58:50 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uSJXE-002vpA-2D for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:58:49 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id B01EEE3FDF; Thu, 19 Jun 2025 17:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1750355927; bh=S/vmqmxDFG4VNCWCpAm8ZOUlQwFjmbxvVAwRB68EExc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=PoS1X1iyx6PbQBYffVi0Jzlgpve/KhXLNY46q5GTMbHDp+6SQxN6voMGwRcX9det7 hwn7ehqsS60bIAwStCRE64+t/3e8MZ4RstqYwF0900Cz/FO7bp3xkzwtLVNsFLz4VU Gt38MgD2ZWHaBxIHhRJODCfUp4QJ6z2a0xCaDMFoX0sAD8sl0+OqTNUWtwweMTz/vZ KS3u9PNsYHzj9GQVmbgF+83GQ+gDGKyupGlE0RBlntdOkQFpdWZqkFxaWKHWepa2iD 7JlspTuX0/9YXo0/YVm9YUZ5Q0bmJ2bcRESHEHORDCMtoZDC4t8FnLBc1+CA3/Ac5W +qhd3RZoCnN1g== X-Virus-Scanned: Debian amavisd-new at emo08-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo08-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z3hb4_p2ObiI; Thu, 19 Jun 2025 17:58:47 +0000 (UTC) Received: from smtpclient.apple (165.140.184.195.ip.vcn.com [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 2F7DBE3F82; Thu, 19 Jun 2025 17:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1750355927; bh=S/vmqmxDFG4VNCWCpAm8ZOUlQwFjmbxvVAwRB68EExc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=PoS1X1iyx6PbQBYffVi0Jzlgpve/KhXLNY46q5GTMbHDp+6SQxN6voMGwRcX9det7 hwn7ehqsS60bIAwStCRE64+t/3e8MZ4RstqYwF0900Cz/FO7bp3xkzwtLVNsFLz4VU Gt38MgD2ZWHaBxIHhRJODCfUp4QJ6z2a0xCaDMFoX0sAD8sl0+OqTNUWtwweMTz/vZ KS3u9PNsYHzj9GQVmbgF+83GQ+gDGKyupGlE0RBlntdOkQFpdWZqkFxaWKHWepa2iD 7JlspTuX0/9YXo0/YVm9YUZ5Q0bmJ2bcRESHEHORDCMtoZDC4t8FnLBc1+CA3/Ac5W +qhd3RZoCnN1g== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: update behavior From: Scott Ribe In-Reply-To: <4CE055A7-2368-4FD2-A900-52BFE4732641@crazybean.net> Date: Thu, 19 Jun 2025 11:58:36 -0600 Cc: Pgsql-admin , Tom Lane Content-Transfer-Encoding: quoted-printable Message-Id: <54495544-60AB-4CC8-9F47-78B33F4D99C4@elevated-dev.com> References: <75F792AF-58DF-4559-A2E8-C89060D1E94E@elevated-dev.com> <4CE055A7-2368-4FD2-A900-52BFE4732641@crazybean.net> To: Rui DeSousa X-Mailer: Apple Mail (2.3826.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jun 19, 2025, at 11:54=E2=80=AFAM, Rui DeSousa = wrote: >=20 >=20 >=20 >> On Jun 19, 2025, at 1:23 PM, Scott Ribe = wrote: >>=20 >> 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". >>=20 >> Is this correct? >>=20 >=20 > Correct, but it can be avoided.=20 >=20 > No update occurs in this case:.=20 >=20 > update foo > set data =3D =E2=80=98hello world=E2=80=99 > where id =3D 33 > and data is distinct from =E2=80=98hello world=E2=80=99 > ; That was my thought when I posted the original question, when I didn't = know about suppress_redundant_updates_trigger. Now I'm thinking the = trigger is an option. - The trigger has the advantage that one doesn't have to maintain the = WHERE clause--especially if the list of columns is long. - It has the disadvantage of always running, even in contexts where it = might not be needed.