Re: Login as different user inside of a function. - Mailing list pgsql-admin

From Stuart
Subject Re: Login as different user inside of a function.
Date
Msg-id 3F0466CB.8020204@blueyonder.co.uk
Whole thread Raw
In response to Database Encryption  ("JR Richards" <jr@ebcrp.org>)
List pgsql-admin
Kris Kiger wrote:
> Here's my problem.  I have user X calling a database function.  The
> function inserts data into table Y.  User X only has select access to
> this table.  Is there some way to allow user X to call a function that
> does an insert for him/her without user X having to have write access to
> table Y?  Is it possible to log in as another user inside of a function?
> Thanks for the help!
>
> Kris

If you are using 7.3 or later you can create the function using SECURITY
DEFINER.
hth,
- Stuart


pgsql-admin by date:

Previous
From: Derek Main
Date:
Subject: Re: zero (o) return code on failure of pg_dump
Next
From: "Daniel Seichter"
Date:
Subject: Re: Advantages and disadvantages of more than one dbserver on one server