Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMz56-00028i-0j for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jun 2017 15:59:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dMz55-00025Y-Jf for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jun 2017 15:59:11 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dMz53-00021l-PN; Mon, 19 Jun 2017 15:59:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dMz51-0007K5-8F; Mon, 19 Jun 2017 15:59:09 +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 v5JFx5Rj000645; Mon, 19 Jun 2017 11:59:05 -0400 From: Tom Lane To: Dilip Kumar cc: Artus de benque , pgsql-bugs@postgresql.org, pgsql-hackers Subject: Re: [BUGS] Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger In-reply-to: References: Comments: In-reply-to Dilip Kumar message dated "Mon, 19 Jun 2017 21:10:11 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <643.1497887945.1@sss.pgh.pa.us> Date: Mon, 19 Jun 2017 11:59:05 -0400 Message-ID: <644.1497887945@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Dilip Kumar writes: > On Mon, Jun 19, 2017 at 5:20 PM, Artus de benque > wrote: >> postgres=# UPDATE test_table SET field = 'hi' WHERE id = 1; >> UPDATE 0 >> test_db=# UPDATE test_table SET field = rpad('', 2001, 'a') WHERE id = 1; >> UPDATE 1 >> test_db=# UPDATE test_table SET field = rpad('', 2001, 'a') WHERE id = 1; >> UPDATE 1 <--- BUG: expected 0, as we ran the same update twice > Seems like in "suppress_redundant_updates_trigger" we are comparing > toasted tuple with the new tuple and that is the cause of the bug. I don't think it's a bug, I think it's an intentional design tradeoff. To suppress an update in this case, the trigger would have to grovel through the individual fields and detoast them before comparing. That would add a lot of cycles, and only seldom add successes. Possibly we should adjust the documentation so that it doesn't imply that this trigger guarantees to suppress every no-op update. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers