Re: cyclical redundancy checksum algorithm(s)? - Mailing list pgsql-general

From Bernhard Weisshuhn
Subject Re: cyclical redundancy checksum algorithm(s)?
Date
Msg-id 451B8E07.5010505@weisshuhn.de
Whole thread Raw
In response to Re: cyclical redundancy checksum algorithm(s)?  (Joachim Wieland <joe@mcknight.de>)
List pgsql-general
Joachim Wieland schrieb:
> On Thu, Sep 28, 2006 at 07:09:43AM +0100, John Sidney-Woollett wrote:
>> Why not use an update trigger on the affected tables to record a
>> lastupdated timestamp value when the record is changed.
>
>> Surely this is simpler thanks computing some kind of row hash?
>
> It depends on how you define "change". With the triggers you propose an
>
> UPDATE table SET col = col;
>
> is a change because there was a write operation. Any hash function's output
> would be "no change" because the actual data did not change. An update might
> entail an expensive update of some external data so you might want to make
> sure that data really got modified.
>

You can always compare the old and new values in the trigger function to
detect that kind of non-update.

bkw

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Dead Lock problem with 8.1.3
Next
From: Martijn van Oosterhout
Date:
Subject: Re: continued segmentation fault