I need to simulate a long-running Connection to PostgreSQL (f.e. 60 seconds) to verify my application can handle it. I believe that by adding a few millions rows to a Table would work, however I'd need a more deterministic approach, such as a PostgreSQL Procedure with a function or a loop. That would not require to fill tables at first and empty them at the end of the test. Can you recommend anything that would work for my case? Thanks
Asked
Active
Viewed 28 times
0
-
2Does this answer your question? [How to create a query that takes long time to run in PostgreSQL](https://stackoverflow.com/questions/35336262/how-to-create-a-query-that-takes-long-time-to-run-in-postgresql) and (related) [Delay or Wait-For Statement](https://stackoverflow.com/questions/1331409/delay-or-wait-for-statement) – Bergi Dec 16 '21 at 07:58
-
2[Use `pg_sleep`](https://database.guide/how-pg_sleep-works-in-postgresql/) – Bergi Dec 16 '21 at 07:59
-
Thanks a lot! that's exactly what I was looking for. – Carla Dec 16 '21 at 08:00