select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / DATE/TIME FUNCTIONS AND OPERATORS

pg_sleep makes the current session's process sleep until the given number of seconds have elapsed.

Signatures & examples

pg_sleep ( double precision )
pg_sleep makes the current session's process sleep until the given number of seconds have elapsed. Fractional-second delays can be specified. pg_sleep_for is a convenience function to allow the sleep time to be specified as an interval. pg_sleep_until is a convenience function for when a specific wake-up time is desired. For example:
Version history 2
  1. PG 12 → 13changed
  2. PG 9.3 → 9.4changed

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source