SQL SLEEP() or pg_sleep() Commands

What are some legitimate reasons to use the SLEEP() or pg_sleep() commands against a SQL server. From the security side of things, I see these a lot in SQL injection scanning and I was just wondering why they are even valid commands.

I use it often for retry logic.

1 Like

Thank you that makes sense. Never thought of that.

And I use it for testing weird locking scenarios and trying to make deadlocks for presentations.

That's probably the most common use :slight_smile: