pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chester c young <chestercyoung@yahoo.com>
To: Bryce Nesbitt <bryce1@obviously.com>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: Proposed archival read only trigger on rows - prevent history modification
Date: Mon, 28 Jan 2008 20:40:11 -0800 (PST)
Message-ID: <771732.23057.qm@web54301.mail.re2.yahoo.com> (raw)
In-Reply-To: <479EA8A3.5070401@obviously.com>


> 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



view thread (7+ messages)  latest in thread

Message-ID: <771732.23057.qm@web54301.mail.re2.yahoo.com>
Permalink:  ../771732.23057.qm@web54301.mail.re2.yahoo.com/
Also on:    postgresql.org/message-id/771732.23057.qm@web54301.mail.re2.yahoo.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: chestercyoung@yahoo.com, bryce1@obviously.com
  Subject: Re: Proposed archival read only trigger on rows - prevent history modification
  In-Reply-To: <771732.23057.qm@web54301.mail.re2.yahoo.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