SLEEP
Waits a specified number of seconds before executing another statement or command.
Syntax
SLEEP( seconds )
Parameters
seconds |
The wait time, specified in one or more seconds (0 or higher) expressed as a positive integer. Single quotes are optional; for example, |
Notes
- This function returns value 0 when successful; otherwise it returns an error message due to syntax errors.
- You cannot cancel a sleep operation.
- Be cautious when using SLEEP() in an environment with shared resources, such as in combination with transactions that take exclusive locks.
Example
The following command suspends execution for 100 seconds:
=> SELECT SLEEP(100); sleep ------- 0 (1 row)