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.