Skip site navigation (1) Skip section navigation (2)

Re: how to get a number of seconds in some interval ?

From: Julius Tuskenis <julius(at)nsoft(dot)lt>
To:
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to get a number of seconds in some interval ?
Date: 2008-05-13 06:20:09
Message-ID: 48293319.2000201@nsoft.lt (view raw or flat)
Thread:
Lists: pgsql-admin
Thank you, it's now clear to me.

Tom Lane rašė:
> Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> writes:
>   
>> Στις Monday 12 May 2008 17:32:39 ο/η Julius Tuskenis έγραψε:
>>     
>>> do you know why division of intervals was not implemented? As I see it - 
>>> there should be an easy way to do so. '1 hour 30 minutes' / '1 hour' = 
>>> 1.5 .... Seems straight forward...
>>>
>>>       
>> No idea why. However as you pose it,it makes sense.
>>     
>
> No, it doesn't really, because intervals contain multiple components.
> What would you define as the result of
> 	'1 month 1 hour' / '1 day'
> bearing in mind that the number of days per month is not fixed, and
> neither is the number of hours per day?
>
> You can derive a number if you're willing to make arbitrary assumptions
> about the relationships of the different units (as indeed extract(epoch)
> does), but hard-wiring such assumptions into a basic arithmetic operator
> doesn't seem like a good idea to me.
>
> 			regards, tom lane
>
>   


-- 
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050


In response to

pgsql-admin by date

Next:From: Achilleas MantziosDate: 2008-05-13 06:56:50
Subject: Re: how to get a number of seconds in some interval ?
Previous:From: Tom LaneDate: 2008-05-12 17:55:22
Subject: Re: context switch storm in 8.1.4 on Xeon XP

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group