Re: Login as different user inside of a function.

From: Stuart <deststar(at)blueyonder(dot)co(dot)uk>
To: Kris Kiger <kris(at)musicrebellion(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Login as different user inside of a function.
Date: 2003-07-03 17:24:27
Message-ID: 3F0466CB.8020204@blueyonder.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Daniel Seichter 2003-07-03 19:47:49 Re: Advantages and disadvantages of more than one dbserver on one server
Previous Message Derek Main 2003-07-03 10:05:12 Re: zero (o) return code on failure of pg_dump