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

From Robert Haas
Subject Re: [PATCH] pg_sleep(interval)
Date
Msg-id CA+TgmoajDzWeeTe0Fc+LjXwopLYt1YgxDc2cuZU0SvDMBkFqyg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] pg_sleep(interval)  (Vik Fearing <vik.fearing@dalibo.com>)
Responses Re: [PATCH] pg_sleep(interval)  (Vik Fearing <vik.fearing@dalibo.com>)
List pgsql-hackers
On Thu, Oct 17, 2013 at 8:26 AM, Vik Fearing <vik.fearing@dalibo.com> wrote:
> On 10/17/2013 10:03 AM, Fabien COELHO wrote:
>> My guess is that it won't be committed if there is a single "but it
>> might break one code or surprise one user somewhere in the universe",
>> but I wish I'll be proven wrong. IMO, "returned with feedback" on a 1
>> liner is really akin to "rejected".
>
> 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.

I find that naming relatively elegant.  However, you've got to
schema-qualify every function and operator used in the definitions, or
you're creating a search-path security vulnerability.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: space reserved for WAL record does not match what was written: panic on windows
Next
From: Peter Geoghegan
Date:
Subject: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE