I would like to test some things and I need a PostgreSQL query that will run rather slow (lasting .01 to 10 seconds) so that I can check that my handling of asynchronous requests is correct. I also need that query to return a result if possible.
At first I started populating the database with thousands of records, but there must be a better way that provides more control over how long the query should run.
pg_sleep(seconds)