Re: Allowing update of column only from trigger

From: "Andrey V(dot) Semyonov" <wilfre(at)mail(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Allowing update of column only from trigger
Date: 2005-01-29 18:45:03
Message-ID: 41FBD9AF.8090802@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

isn't it possible to restrict UPDATE by access rights based on the DB's
user?

Create table with owner set to the administrator of the database (NOT
PostgreSQL SERVER!!!) and grant only the needed rights (or none of them)
to the user from which the usual processing of the database will be
performed. Then, create a trigger function with SECURITY DEFINER set and
own it by the owner of the database (or other user, who's granted to
UPDATE the table). So, if no one else is granted UPDATE on the table,
the only UPDATE-modifiers of the table will be the owner and the trigger
function's owner (if differs from owner).

Best regards,
Andrey V. Semyonov

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar Hafstað 2005-01-29 19:00:54 Re: Prompt User From a pgplsql Function
Previous Message Josh Berkus 2005-01-29 18:25:13 Re: MySQL worm attacks Windows servers