Re: grant problem - Mailing list pgsql-admin

From Bruno Wolff III
Subject Re: grant problem
Date
Msg-id 20050327154756.GB9280@wolff.to
Whole thread Raw
In response to grant problem  (Rajarshi Mukherjee <mukherjee.rajarshi@gmail.com>)
List pgsql-admin
On Tue, Mar 22, 2005 at 11:22:07 +0530,
  Rajarshi Mukherjee <mukherjee.rajarshi@gmail.com> wrote:
> Dear Sir/Madam,
>
> I have a problem regarding grants in PG. It is as follows:
>
> I wanted to grant execute on a function that updates a table.
> But i got an ERROR: permission denied for relation <table_name>
>
> Now i don't want to grant update on that table as i want all updates
> to be done through the function, and no one should be able to update
> it manually.
>
> How can i achieve that?

Grant UPDATE access to the table to the owner of the function, create
the function with the SECURITY DEFINER access and give EXECUTE access
(you will want to revoke EXECUTE from public as that is the default for
functions) to the function to the users that should be able to use it.

pgsql-admin by date:

Previous
From: Jos van Roosmalen
Date:
Subject: Help: my table is corrupt!
Next
From: Bruno Wolff III
Date:
Subject: Re: PostgreSQL: ´GRANT AL