Re: Permissions within a function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Permissions within a function
Date: 2004-12-18 17:59:06
Message-ID: 2714.1103392746@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Hallgren <thhal(at)mailblocks(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Hallgren 2004-12-18 18:18:10 Re: Permissions within a function
Previous Message Tom Lane 2004-12-18 17:30:01 Re: double error msg [ 8.0 rc1 ]