postgresql – Limit Postgres results for a user

I would like to grant a Postgres user access to a public_data display and allow them to execute user-defined SQL queries.

However, since the view is quite large (5 million lines), I would like to prevent users from executing queries that could accidentally return huge sets of results.

CREATE VIEW public_data AS SELECT * FROM data limit 10; only seems to give me the first 10 results, no matter what request I make against public_data.

Ideally, I would like users to be able to run SELECT * FROM public_data WHERE ...; but anyway have LIMIT 10 automatically included before the execution of the instruction.

Is it possible to do this without creating a custom function?