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 BDD079FB2F3 for ; Fri, 4 Aug 2006 22:28:02 -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 24087-01 for ; Fri, 4 Aug 2006 22:27:54 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by postgresql.org (Postfix) with ESMTP id D45689FB2DD for ; Fri, 4 Aug 2006 22:27:54 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id n28so271876nfc for ; Fri, 04 Aug 2006 18:27:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=eveRs/HRwAW/bmn/l+ifrZZatlPE0dvzFrl2Z2mXhuEd+ingOid2+yU95JFPteYVfKN2oF2uPJTFsXrg1i3Wiz9J7HArSkAhXsWj3vGGwNe2EG2t7IAay/0UpII16/0m4LCBQzvIn6W8hYFdmRFxxgH5r0L6MCUFpIzdEJVfduc= Received: by 10.78.142.14 with SMTP id p14mr1767931hud; Fri, 04 Aug 2006 18:27:52 -0700 (PDT) Received: by 10.78.56.16 with HTTP; Fri, 4 Aug 2006 18:27:52 -0700 (PDT) Message-ID: <7c33d060608041827y8835d82q85772f56eced621f@mail.gmail.com> Date: Sat, 5 Aug 2006 08:27:52 +0700 From: "David Garamond" To: "Richard Huxton" Subject: Re: autoupdating mtime column Cc: "Tom Lane" , pgsql-sql@postgresql.org In-Reply-To: <44D38F8A.8040302@archonet.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_44887_8542555.1154741272455" References: <7c33d060608040516n799af906sf74e1c645a47caff@mail.gmail.com> <44D34242.6000901@archonet.com> <7c33d060608040811s6dcaa3abia137188076a76781@mail.gmail.com> <29505.1154707823@sss.pgh.pa.us> <7c33d060608041036k59056658o5acd68df36d0bbb6@mail.gmail.com> <44D38F8A.8040302@archonet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.063 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: * X-Archive-Number: 200608/42 X-Sequence-Number: 26000 ------=_Part_44887_8542555.1154741272455 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/5/06, Richard Huxton wrote: > > >> 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. > That's a nice idea indeed. Thanks! -- dave ------=_Part_44887_8542555.1154741272455 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/5/06, Richard Huxton <dev@archonet.com> wrote:
>> 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.

That's a nice idea indeed. Thanks!

--
dave
------=_Part_44887_8542555.1154741272455--