SLEEP in posgresql - Mailing list pgsql-general

From Jasbinder Singh Bali
Subject SLEEP in posgresql
Date
Msg-id a47902760710091956t558b8323nde3988fec49a0971@mail.gmail.com
Whole thread Raw
Responses Re: SLEEP in posgresql
Re: SLEEP in posgresql
List pgsql-general
Hi,

I have a while loop and I want to re-iterate after every 't' seconds.
I was reading up on the postgresql documentation that says pg_sleep(t) should be handy.
However i doesn't work.

Instead of that, I re-engineered my while loop in the stored procedure as follows.

while  a=b loop
 --do something
select pg_sleep(5);
end loop

I doubt this would work because when I try to run
SELECT pg_sleep(5) stand alone, it throws error.

I was wondering how to implement the SLEEP functionality here.

Thanks,
~Jas

pgsql-general by date:

Previous
From: "Filip Rembiałkowski"
Date:
Subject: Re: How to speedup intarray aggregate function?
Next
From: Guy Rouillier
Date:
Subject: Re: SLEEP in posgresql