Re: Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger

From: J Chapman Flack <jflack(at)math(dot)purdue(dot)edu>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Artus de benque <artusdebenque(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger
Date: 2017-06-19 18:18:50
Message-ID: 3b45ea7f-3434-8d97-9177-f1174131fc9a@math.purdue.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 06/19/2017 11:40 AM, Dilip Kumar wrote:
> ... Artus de benque ... wrote:
>> ...=# UPDATE test_table SET field = rpad('', 2001, 'a') WHERE id = 1;
>
> Seems like in "suppress_redundant_updates_trigger" we are comparing
> toasted tuple with the new tuple and that is the cause of the bug.

Something still puzzles me about this, though, maybe only because
I don't know enough about TOAST.

The size of 'field' ends up 2001, or just over the threshold where
TOASTing will be attempted at all. The report doesn't mention changing
the strategy from the default EXTENDED, so won't the first thing
attempted be compression? Won't that succeed spectacularly, since the
test string is a single character 2001 times, probably producing
a compressed string a handful of bytes long, well under the threshold,
obviating any need to go further with TOAST pointers?

Is the compression algorithm nondeterministic? Is there some way
that compressing the same 2001*'a' on two occasions would produce
compressed strings that don't match?

What exactly is s_r_u_t() comparing, in the case where the TOASTed
value has been compressed, but not out-of-lined?

-Chap

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-06-19 20:37:27 Re: [HACKERS] Re: Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger
Previous Message Bruno Richard 2017-06-19 17:29:34 PostgreSQL hot standby Hangs due to AccessExclusiveLock on pg_attribute or pg_type tables

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2017-06-19 18:24:43 Optional message to user when terminating/cancelling backend
Previous Message Matt Pulver 2017-06-19 18:15:20 Re: INSERT ... ON CONFLICT () SELECT