Tom Lane wrote:

Brendan Jurd <[EMAIL PROTECTED]> 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 function.

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.

BJ

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to