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

From: Bryce Nesbitt <bryce1(at)obviously(dot)com>
To: sql pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Proposed archival read only trigger on rows - prevent history modification
Date: 2008-02-12 08:25:46
Message-ID: 47B1580A.7050703@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bryce Nesbitt 2008-02-12 08:30:32 Re: Proposed archival read only trigger on rows - prevent history modification
Previous Message Bryce Nesbitt 2008-02-12 08:22:20 Backward compatibility psql 8.1 to 8.2