Get partial results in Postgres in case of timeout? Is it possible to send a query that does a sequential scan of the table - something like
SELECT content
  FROM some_big_table
 WHERE &lt;some criteria(content) are met&gt;;
 LIMIT &lt;...&gt;;

with a time limit (e. g. 1000 milliseconds) - so that the query terminates after the specified time period and returns any rows it could find by that time as a result of the scan?
I'm not worried about the result being predictable - I just need to give the user the first matches the server can find, if any.
SET statement_timeout does not help here as it cancels the query altogether if it doesn't execute within the time limit, while I need the partial results.
There is nothing to do exactly what you want, making a query end normally on the server based on a time limit rather than a row LIMIT.  You could declare a cursor and then FETCH rows in chunks (perhaps chunks of 1), closing the cursor after a certain amount of time has passed as witnessed on the client. Depending on the driver you are using, there may be other options to get similar results, such as PQsetSingleRowMode in libpq.