Re: [PATCH] pg_sleep(interval) - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [PATCH] pg_sleep(interval)
Date
Msg-id alpine.DEB.2.02.1310171532000.10513@sto
Whole thread Raw
In response to Re: [PATCH] pg_sleep(interval)  (Vik Fearing <vik.fearing@dalibo.com>)
List pgsql-hackers
Hello Vik,

> I have attached here an entirely new patch (new documentation and
> everything) that should please everyone.  It no longer overloads
> pg_sleep(double precision) but instead add two new functions:
>
> * pg_sleep_for(interval)
> * pg_sleep_until(timestamp with time zone)
>
> Because it's no longer overloading the original pg_sleep, Robert's
> ambiguity objection is no more.
>
> Also, I like how it reads aloud: SELECT pg_sleep_for('5 minutes');
>
> If people like this, I'll reject the current patch and add this one to
> the next commitfest.
>
> Opinions?

I liked overloading...

Anyway, I have not looked at the patch in details, but both functions 
seems useful at least if you need to sleep, and the solution is 
reasonable.

I also like "pg_sleep_until('tomorrow');" that I guess would work, but I'm 
not sure of any practical use case for this one. Do you have an example 
where it makes sense?

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [PATCH] hstore_to_json: empty hstores must return empty json objects
Next
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] pg_sleep(interval)