Re: Proposed archival read only trigger on rows - prevent history modification

Поиск
Список
Период
Сортировка
От chester c young
Тема Re: Proposed archival read only trigger on rows - prevent history modification
Дата
Msg-id 771732.23057.qm@web54301.mail.re2.yahoo.com
обсуждение исходный текст
Ответ на Proposed archival read only trigger on rows - prevent history modification  (Bryce Nesbitt <bryce1@obviously.com>)
Ответы Re: Proposed archival read only trigger on rows - prevent history modification  (Bryce Nesbitt <bryce1@obviously.com>)
Список pgsql-sql
> 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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Bryce Nesbitt
Дата:
Сообщение: Proposed archival read only trigger on rows - prevent history modification
Следующее
От: "Premsun Choltanwanich"
Дата:
Сообщение: Re: Slow Query problem