pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: David Garamond <davidgaramond@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: autoupdating mtime column
Date: Fri, 04 Aug 2006 19:18:50 +0100
Message-ID: <44D38F8A.8040302@archonet.com> (raw)
In-Reply-To: <7c33d060608041036k59056658o5acd68df36d0bbb6@mail.gmail.com>
References: <7c33d060608040516n799af906sf74e1c645a47caff@mail.gmail.com>
	<44D34242.6000901@archonet.com>
	<7c33d060608040811s6dcaa3abia137188076a76781@mail.gmail.com>
	<29505.1154707823@sss.pgh.pa.us>
	<7c33d060608041036k59056658o5acd68df36d0bbb6@mail.gmail.com>

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



view thread (10+ messages)  latest in thread

Message-ID: <44D38F8A.8040302@archonet.com>
Permalink:  ../44D38F8A.8040302@archonet.com/
Also on:    postgresql.org/message-id/44D38F8A.8040302@archonet.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, davidgaramond@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: autoupdating mtime column
  In-Reply-To: <44D38F8A.8040302@archonet.com>

* 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