I want to create an SQL sandbox that will allow users to execute arbitrary SELECT
queries at a PostGIS database. Essentially, I want to allow users access to psql
to play with.
Obviously this is a security disaster if write access is allowed. How can I create a system such that querying data is allowed, but there is no reasonable possibility of a user:
- Compromising the data in the database
- Gaining broader access to the server
- Crippling the system with a query like
SELECT * from long_table, long_table, long_table, long_table, long_table, long_table, long_table
that will take a life-time to execute
Please be as specific as possible in your answer.