Re: grant problem

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Rajarshi Mukherjee <mukherjee(dot)rajarshi(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: grant problem
Date: 2005-03-27 15:47:56
Message-ID: 20050327154756.GB9280@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Mar 22, 2005 at 11:22:07 +0530,
Rajarshi Mukherjee <mukherjee(dot)rajarshi(at)gmail(dot)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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bruno Wolff III 2005-03-27 15:50:26 Re: PostgreSQL: ´GRANT AL
Previous Message Jos van Roosmalen 2005-03-27 15:19:33 Help: my table is corrupt!