pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stuart <deststar@blueyonder.co.uk>
To: Kris Kiger <kris@musicrebellion.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Login as different user inside of a function.
Date: Thu, 03 Jul 2003 18:24:27 +0100
Message-ID: <3F0466CB.8020204@blueyonder.co.uk> (raw)
In-Reply-To: <3F02FBF2.6080308@musicrebellion.com>
References: <001201c334fc$eb5476d0$4502a8c0@MINNIE>
	<200306190711.47509.jgardner@jonathangardner.net>
	<3F02FBF2.6080308@musicrebellion.com>

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




Message-ID: <3F0466CB.8020204@blueyonder.co.uk>
Permalink:  ../3F0466CB.8020204@blueyonder.co.uk/
Also on:    postgresql.org/message-id/3F0466CB.8020204@blueyonder.co.uk

 · 

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: deststar@blueyonder.co.uk, kris@musicrebellion.com
  Subject: Re: Login as different user inside of a function.
  In-Reply-To: <3F0466CB.8020204@blueyonder.co.uk>
  References: <001201c334fc$eb5476d0$4502a8c0@MINNIE> <200306190711.47509.jgardner@jonathangardner.net> <3F02FBF2.6080308@musicrebellion.com> <3F0466CB.8020204@blueyonder.co.uk>

* 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