Re: Permissions within a function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Permissions within a function
Date
Msg-id 2714.1103392746@sss.pgh.pa.us
Whole thread Raw
In response to Re: Permissions within a function  (Thomas Hallgren <thhal@mailblocks.com>)
Responses Re: Permissions within a function
List pgsql-hackers
Thomas Hallgren <thhal@mailblocks.com> writes:
> Peter Eisentraut wrote:
>> You can use GetUserId() and SetUserId() to flip the current user 
>> identity around as you like.  For such a simple query, however, it 
>> might seem better to bypass SPI altogether and do a straight table 
>> lookup through lower-level functions.
>> 
> Brilliant! I had no idea it was that simple.

Well, it's not.  Exactly what are you going to flip it *to*?  You can't
hardwire a particular userid and expect to have a robust solution.

I'd recommend the lower-level approach myself.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: double error msg [ 8.0 rc1 ]
Next
From: Thomas Hallgren
Date:
Subject: Re: Permissions within a function