News for hackers. Stuff that matters.
Re:Row Level Security with PostgreSQL 9.5 by Jweb_Guru on Wednesday April 20, 2016 @04:51PM (#11537658)
I'm pretty sure it's not possible to prevent a role from setting session parameters.

I believe it is not possible to SET ROLE or SET SESSION AUTHORIZATION with code executed within a SECURITY DEFINER function (which is what you're asking to do), though as Tom Lane points out one shouldn't rely on that:

http://www.postgresql.org/message-id/[email protected]...

Given arbitrary SQLi, it's hard to see how one can do better than setting up an untrusted sandbox like that and executing your untrusted SQL there, but being able to prevent setting a session parameter would still be useful within that context.

Re:Row Level Security with PostgreSQL 9.5 by dsp1234 on Wednesday April 20, 2016 @05:12PM (#11537800)
I was hoping for something like mssql's "EXECUTE AS... NO REVERT" where reverting back to the previous role can be prevented.
Re:Row Level Security with PostgreSQL 9.5 by haberman on Wednesday April 20, 2016 @07:41PM (#11538570)
Or in UNIX terms, this is simply "sudo -u". Seems like something that would be pretty useful.