Re: Time span conversion function
От | Brendan Jurd |
---|---|
Тема | Re: Time span conversion function |
Дата | |
Msg-id | 41E8B056.8070002@blakjak.sytes.net обсуждение исходный текст |
Ответ на | Re: Time span conversion function (Kris Jurka <books@ejurka.com>) |
Ответы |
Re: Time span conversion function
|
Список | pgsql-hackers |
Kris Jurka wrote: >On Sat, 15 Jan 2005, Brendan Jurd wrote: > > > >> > SELECT time_span( 'minute', now(), interval '10:43:55' ); >>643 >> >> >> > >The timestamp argument to this version of the function seems completely >irrelevent. > >Kris Jurka > > I don't think so. As I pointed out in the OP, to make this function work properly you need to define a startpoint and an endpoint. The version of the function which accepts (text, timestamp, interval) arguments is really just using another notation to achieve the same thing - startpoint and endpoint. The timestamp argument is only irrelevant if you're willing to assume now() is going to be the startpoint, which is not a fair assumption IMO. I would rather give the caller the freedom of defining the startpoint himself, in either notation. 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). Does that resolve your concern? If not please explain it more fully. BJ
В списке pgsql-hackers по дате отправления: