timespan/2 - Mailing list pgsql-general

From Carlos Fonseca
Subject timespan/2
Date
Msg-id Pine.LNX.3.96.990109221411.8450A-100000@gaivota.localnet
Whole thread Raw
List pgsql-general
Dear all,

I need to compute the half of given timespan values, and was surprised to
see that, e.g., ('1h'::timespan)/2 doesn't work, whereas
('1h'::timespan)/(2::timespan) does. This isn't just inconvenient, it
looks wrong as well: try '1h'::timespan/'0s300ms'::timespan,
when you really mean '1h'::timespan/0.3.

Is this a bug or a design decision? Shouldn't division of two timespan
values return a float, and division of a timespan value by an int/float
return a timespan? I am using postgresql v6.4.2.

Please Cc: any replies to me, as I am not on the list (for now)...

TIA,

Carlos



pgsql-general by date:

Previous
From: Oleg Broytmann
Date:
Subject: Z Object Publisher got Postgres adapter
Next
From: "Thomas G. Lockhart"
Date:
Subject: [Fwd: [HACKERS] postgres and dates (year 2000? not!)]