Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id EE8252E0311 for ; Tue, 12 Feb 2008 04:25:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 54698-08 for ; Tue, 12 Feb 2008 04:24:48 -0400 (AST) Received: from outK.internet-mail-service.net (outK.internet-mail-service.net [216.240.47.234]) by postgresql.org (Postfix) with ESMTP id AAAEE2E0321 for ; Tue, 12 Feb 2008 04:25:00 -0400 (AST) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Tue, 12 Feb 2008 00:24:58 -0800 X-Client-Authorized: MaGic Cook1e Received: from [192.168.1.109] (adsl-71-135-191-42.dsl.pltn13.pacbell.net [71.135.191.42]) by idiom.com (Postfix) with ESMTP id 283B5127190 for ; Tue, 12 Feb 2008 00:24:58 -0800 (PST) Message-ID: <47B1580A.7050703@obviously.com> Date: Tue, 12 Feb 2008 00:25:46 -0800 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20070803 SUSE/1.1.7-0.1 SeaMonkey/1.1.7 MIME-Version: 1.0 To: sql pgsql Subject: Re: Proposed archival read only trigger on rows - prevent history modification References: <771732.23057.qm@web54301.mail.re2.yahoo.com> In-Reply-To: <771732.23057.qm@web54301.mail.re2.yahoo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.179 tagged_above=0 required=5 tests=AWL=0.178, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200802/87 X-Sequence-Number: 30178 Yes, the view approach has some advantages. But it still leaves the underlying tables naked to modification. And since the most likely error is... well... me (or another admin) at the SQL prompt, we want underlying tables protected also. chester c young wrote: > instead of triggers I use update-able views and permissions. > > 1. all dml goes through the view > 2. use rules on the view to do dml to the table > 3. in rules prevent updating all/any columns when whatever > 4. grant dml to view to your pgconnect user > 5. revoke dml from table to your pgconnect user > > imho another instance where rules rule. for example, you can easily > fit logging into the same view. > -- ---- Visit http://www.obviously.com/