Tomas at 2nd Quadrant wrote a nice article about doing that: You can also look at how projects like PostgREST (http://postgrest.com/) and PostGaphQL (https://github.com/calebmer/postgraphql) tackle the problem (although I don’t recall at the moment if they are as careful about avoiding the possibility of an unprotected SET ROLE as Tomas is in the above article). Best, Alex |