Re: Re-enabling SET ROLE in security definer functions
Turner, Ian <ian.turner@deshaw.com>
From: "Turner, Ian" <Ian.Turner@deshaw.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Gurjeet Singh <singh.gurjeet@gmail.com>
Cc: PGSQL Hackers <pgsql-hackers@postgresql.org>, George Williams <george.williams@enterprisedb.com>
Date: 2009-12-31T18:09:40Z
Lists: pgsql-hackers
> -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Actually, I don't find that to be a given. Exactly what use-cases have > you got that aren't solved as well or better by calling a SECURITY DEFINER > function owned by the target role? Oh, that's easy: If you want to do the equivalent of setreuid(geteuid(), getuid()); that is, if you want to drop privileges for a particular operation. Our particular use case is that we want to evaluate an expression provided by the caller but with the caller's privileges. Cheers, --Ian