Re: User with GRANTS only on Views. Lock table on function will work?

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Andre Lopes <lopes80andre(at)gmail(dot)com>
Cc: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: User with GRANTS only on Views. Lock table on function will work?
Date: 2010-04-25 14:54:57
Message-ID: 4BD457C1.40503@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 25/04/2010 13:24, Andre Lopes wrote:
> Hi,
>
> I have a database were the users only can do operations using views,
> they have not access to physical tables. But I have a function with a
> lock on a physical table. Can I allow this users to run a function that
> locks a physical table?

You can create a function with SECURITY DEFINER, allowing it to be run
with the privileges of the users who created it rather than the user who
is running it. See here:

http://www.postgresql.org/docs/8.4/static/sql-createfunction.html

Would this do what you need?

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message dario.ber@libero.it 2010-04-25 15:59:12 R: Catch exception from plpy
Previous Message Megha 2010-04-25 13:00:23 debug pgpool