On 14 Mar 2002, Lars Preben S. Arnesen wrote:
> [ Stephan Szabo ]
>
> > Well, I'm not sure you can using only pl/pgsql, but if you don't grant
> > access to any of the tables, I know that in C you can have functions run
> > queries as a different user.
>
> This sounds interesting. Is there any simple examples for doing stuff
> like this?
Well, it involves SPI stuff and I think there's some docs on that and
examples floating around. In the referential integrity triggers it
sets the user to the owner of the table that it's scanning
(backend/utils/adt/ri_triggers.c) but I wouldn't call that stuff
simple really.