Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E3E1C2E02AE for ; Tue, 29 Jan 2008 00:40:13 -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 64584-04 for ; Tue, 29 Jan 2008 00:40:12 -0400 (AST) Received: from web54301.mail.re2.yahoo.com (web54301.mail.re2.yahoo.com [206.190.49.111]) by postgresql.org (Postfix) with SMTP id B7A822E00C8 for ; Tue, 29 Jan 2008 00:40:12 -0400 (AST) Received: (qmail 25231 invoked by uid 60001); 29 Jan 2008 04:40:11 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=DKryCbRV5PX0O8S/5vM0NBTQml7zdm9A+QVE5jeiyKxnQjPWtB3fTxMiVqHNsJPvJrxFBJN1CuNlECATFwzLzniXNlBpxGe/cPfPgQaxHow6qziEsSs35VVfRl92yudi1zM+vAOP6n2uIeWO/Zykvgg4scxWbHJntEU3KZYYuCc=; X-YMail-OSG: f17eiz8VM1mEAFMroqZFO2o1hnXigMSIJVhxIIsK Received: from [118.175.194.13] by web54301.mail.re2.yahoo.com via HTTP; Mon, 28 Jan 2008 20:40:11 PST Date: Mon, 28 Jan 2008 20:40:11 -0800 (PST) From: chester c young Subject: Re: Proposed archival read only trigger on rows - prevent history modification To: Bryce Nesbitt Cc: sql pgsql In-Reply-To: <479EA8A3.5070401@obviously.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <771732.23057.qm@web54301.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/218 X-Sequence-Number: 30071 > I'm considering building a protective mechanism, and am seeking > feedback > on the idea. The approach would be to add a new column named "ro" to > each table at invoice level and below. Then have a trigger on > 'ro'==true deny the write, and probably raise a huge stink. As > invoice > are mailed each month, all the supporting data would be set to "ro" > true. 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. ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs