From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Artus de benque <artusdebenque@gmail.com>
Cc: pgsql-bugs@postgresql.org, pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger
Date: Mon, 19 Jun 2017 11:59:05 -0400
Message-ID: <644.1497887945@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFiTN-tQat3h8qDVH1Z+KpYOL_PwCG0zYDzfbt-YnRxByfhSvw@mail.gmail.com>
References: <CAHhcnVQESG2XkF+JATAQF20TXUHDcvzw4k4JAsLhF7bJzhfriQ@mail.gmail.com>
<CAFiTN-tQat3h8qDVH1Z+KpYOL_PwCG0zYDzfbt-YnRxByfhSvw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Dilip Kumar <dilipbalaut@gmail.com> writes:
> On Mon, Jun 19, 2017 at 5:20 PM, Artus de benque
> <artusdebenque@gmail.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, dilipbalaut@gmail.com, artusdebenque@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [BUGS] Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger
In-Reply-To: <644.1497887945@sss.pgh.pa.us>
References: <CAHhcnVQESG2XkF+JATAQF20TXUHDcvzw4k4JAsLhF7bJzhfriQ@mail.gmail.com> <CAFiTN-tQat3h8qDVH1Z+KpYOL_PwCG0zYDzfbt-YnRxByfhSvw@mail.gmail.com> <644.1497887945@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox