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

From Peter Eisentraut
Subject Re: Permissions within a function
Date
Msg-id 200412181015.01219.peter_e@gmx.net
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 wrote:
> Is there a way to bypass security checks that retains the SQL parser?
> I'd like my C-code to do something like:
>
> impersonate pgadmin
> SELECT image from class_table
> revert to self

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.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: Mike G
Date:
Subject: Re: Dump from cygwin directly to windows
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: double error msg [ 8.0 rc1 ]