X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 1C9DCB43A28 for ; Thu, 3 Jul 2003 17:24:22 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 82831-04 for ; Thu, 3 Jul 2003 14:24:11 -0300 (ADT) Received: from smtp-out6.blueyonder.co.uk (smtp-out6.blueyonder.co.uk [195.188.213.9]) by svr1.postgresql.org (Postfix) with ESMTP id 13B62B43A20 for ; Thu, 3 Jul 2003 14:24:10 -0300 (ADT) Received: from blueyonder.co.uk ([80.192.87.34]) by smtp-out6.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5329); Thu, 3 Jul 2003 18:23:09 +0100 Message-ID: <3F0466CB.8020204@blueyonder.co.uk> Date: Thu, 03 Jul 2003 18:24:27 +0100 From: Stuart User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-gb, en, en-us MIME-Version: 1.0 To: Kris Kiger Cc: pgsql-admin@postgresql.org Subject: Re: Login as different user inside of a function. References: <001201c334fc$eb5476d0$4502a8c0@MINNIE> <200306190711.47509.jgardner@jonathangardner.net> <3F02FBF2.6080308@musicrebellion.com> In-Reply-To: <3F02FBF2.6080308@musicrebellion.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jul 2003 17:23:09.0875 (UTC) FILETIME=[C63C8030:01C34187] X-Archive-Number: 200307/30 X-Sequence-Number: 9371 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