X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id AE4609FA28E for ; Fri, 4 Aug 2006 15:18:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 18226-02 for ; Fri, 4 Aug 2006 15:18:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 878F39FB383 for ; Fri, 4 Aug 2006 15:18:53 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id B992A74276; Fri, 4 Aug 2006 19:18:51 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 676254DB33; Fri, 4 Aug 2006 19:18:51 +0100 (BST) Message-ID: <44D38F8A.8040302@archonet.com> Date: Fri, 04 Aug 2006 19:18:50 +0100 From: Richard Huxton User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: David Garamond Cc: Tom Lane , pgsql-sql@postgresql.org Subject: Re: autoupdating mtime column References: <7c33d060608040516n799af906sf74e1c645a47caff@mail.gmail.com> <44D34242.6000901@archonet.com> <7c33d060608040811s6dcaa3abia137188076a76781@mail.gmail.com> <29505.1154707823@sss.pgh.pa.us> <7c33d060608041036k59056658o5acd68df36d0bbb6@mail.gmail.com> In-Reply-To: <7c33d060608041036k59056658o5acd68df36d0bbb6@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.583 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/41 X-Sequence-Number: 25999 David Garamond wrote: > On 8/4/06, Tom Lane 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