I would like to grant a Postgres user access to a
public_data view and allow them to execute user defined SQL queries against it.
However, the view is quite large (5M rows), so I'd like to prevent users from executing queries that could accidentally return huge results sets.
CREATE VIEW public_data AS SELECT * FROM data limit 10; only seems to give me the first 10 results no matter what query I run against
Ideally, I'd like users to be able to run
SELECT * FROM public_data WHERE ...; but somehow have
LIMIT 10 automatically included prior to executing the statement.
Is there any way to do this without creating a custom function?