Re: autoupdating mtime column - Mailing list pgsql-sql

From David Garamond
Subject Re: autoupdating mtime column
Date
Msg-id 7c33d060608041036k59056658o5acd68df36d0bbb6@mail.gmail.com
Whole thread Raw
In response to Re: autoupdating mtime column  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: autoupdating mtime column
List pgsql-sql
On 8/4/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
If you are really intent on having a way to suppress the mtime update
you could dedicate an additional field to the purpose, eg

UPDATE t SET foo=..., bar=..., keepmtime = true ...

and in the trigger something like

        if new.keepmtime then
                new.keepmtime = false;
        else
                new.mtime = now();

As long as nothing else ever touches keepmtime this would work.
Personally I'm dubious that it's worth the trouble

Yeah, it's too expensive an overhead just for the sake of a slightly shorter UPDATE statement. 

--- do you
have a real use-case for suppressing mtime updates?

Syncing tables between databases (a la "rsync --times"). Btw, I'm considering temporarily disabling the update_times() trigger when sync-ing.

Thanks,
--
dave

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: autoupdating mtime column
Next
From: Richard Huxton
Date:
Subject: Re: autoupdating mtime column