Re: autoupdating mtime column

From: Richard Huxton <dev(at)archonet(dot)com>
To: David Garamond <davidgaramond(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-sql(at)postgresql(dot)org
Subject: Re: autoupdating mtime column
Date: 2006-08-04 18:18:50
Message-ID: 44D38F8A.8040302@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

David Garamond wrote:
> On 8/4/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> --- 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.

I'd consider running the sync as a different (privileged) user and
checking the current user in the trigger. Ordinary users always get
now(), privileged users always get what they provide (and they are
forced to provide some value). Does what you want and adds a safety
catch too.

Alternatively, you could do something similar with views.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message sergey 2006-08-04 18:55:59 select query optimization
Previous Message David Garamond 2006-08-04 17:36:42 Re: autoupdating mtime column