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

From Tom Lane
Subject Re: [PATCH] pg_sleep(interval)
Date
Msg-id 16727.1376697147@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] pg_sleep(interval)  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: [PATCH] pg_sleep(interval)  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: [PATCH] pg_sleep(interval)  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On 8/16/13 3:35 PM, Robert Haas wrote:
>> On Fri, Aug 16, 2013 at 2:57 PM, Greg Stark <stark@mit.edu> wrote:
>>> Except there are no data types that can be cast to both double and
>>> interval currently.

>> That, unfortunately, is not sufficient to avoid a problem.

> That example can be used as an argument against almost any kind of
> overloading.

True.  I think the gripe here is that pg_sleep('42') has worked for
many releases now, and if we add this patch then it would suddenly
stop working.  How common is that usage likely to be (probably not
very), and how useful is it to have a version of pg_sleep that
takes an interval (probably also not very)?

Since the same effect can be had by writing a user-defined SQL function,
I'm a bit inclined to say that the value-added by having this as a
built-in function doesn't justify the risk of breaking existing apps.
It's a close call though, because both the risk and the value-added seem
rather small from here.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 9.4 regression
Next
From: Michael Cronenworth
Date:
Subject: Fix Windows socket error checking for MinGW