PostgreSQL Sleep Function pg_sleep – Postgres Delay Execution - Comment Page: 1

One day, I was looking for PostgreSQL database function, which could delay the execution of queries. At first I thought that I will do one myself, because I do not remember ever seen this kind function. But then I found pg_sleep Postgres function which directly delay execution of the server process. pg_sleep makes the current session's process sleep until seconds seconds have elapsed. Seconds is a value of type double precision, so fractional-second delays can be specified. pg_sleep function usage is as easy as it should be: SELECT pg_sleep(seconds); A real example, which adds 60 seconds delay between two queries: SELECT CURRENT_TIMESTAMP; SELECT pg_sleep(60); SELECT...