pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Rajarshi Mukherjee <mukherjee.rajarshi@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: grant problem
Date: Sun, 27 Mar 2005 09:47:56 -0600
Message-ID: <20050327154756.GB9280@wolff.to> (raw)
In-Reply-To: <df10886f050321215214cf7ddb@mail.gmail.com>
References: <df10886f050321215214cf7ddb@mail.gmail.com>

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.



view thread (2+ messages)

Message-ID: <20050327154756.GB9280@wolff.to>
Permalink:  ../20050327154756.GB9280@wolff.to/
Also on:    postgresql.org/message-id/20050327154756.GB9280@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: bruno@wolff.to, mukherjee.rajarshi@gmail.com
  Subject: Re: grant problem
  In-Reply-To: <20050327154756.GB9280@wolff.to>
  References: <df10886f050321215214cf7ddb@mail.gmail.com> <20050327154756.GB9280@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox