Tom Lane wrote:
>Brendan Jurd <blakjak(at)blakjak(dot)sytes(dot)net> writes:
>>Of course, it would be possible to create a shorthand version of the
>>function which expects (text, interval), and passes directly to
>>time_span($1, now(), $2).
>This bothers me a bit. That essentially says that (text, interval)
>has a hidden instability: the results depend on when you execute it.
>If we allow this form, it should be restricted to only those units
>(values of the text parameter) for which the result would *not*
>depend on now().
mm, I see your point. I suppose the only real reason to have the
shorthand version is for people who want to test an interval value and
don't particularly care what the startpoint is -- so they just use now()
because it's a convenient way of getting a timestamp that satisfies the
To be honest, I'd be quite comfortable with dropping the shorthand
version from the proposal. If the caller has to type another 7
characters, so be it. It could fall under the "if you want it, define
your own function for it" category.
In response to
pgsql-hackers by date
|Next:||From: Greg Stark||Date: 2005-01-15 07:14:17|
|Subject: Re: sparse (static analyzer) report|
|Previous:||From: Tom Lane||Date: 2005-01-15 06:20:23|
|Subject: Re: Time span conversion function |