Re: [SQL] adding time to a datetime field ... how? - Mailing list pgsql-sql

From Margarit Nickolov
Subject Re: [SQL] adding time to a datetime field ... how?
Date
Msg-id Pine.BSI.4.05L.9912171142560.11313-100000@developer.digsys.bg
Whole thread Raw
In response to Re: [SQL] adding time to a datetime field ... how?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-sql
 timespan type is `` time interval '@ <number> <units>' '' (try: db=>\dT),
 and you can convert int4 to any timespan units this way:
 textcat(int4_field, ' units_you_like')::timespan

units can be: secs, mins, hours, days, months, years 

Margarit.


On Fri, 17 Dec 1999, Peter Eisentraut wrote:

> On 1999-12-15, Margarit Nickolov mentioned:
> 
> > select start_time,start_time+acctsessiontime::timespan from log;
> 
> Wow, that is really weird. I would consider it confusing behaviour at
> best if an explicit cast interprets an int as seconds whereas an implicit
> conversion thinks it's days.
> 
> 
> -- 
> Peter Eisentraut                  Sernanders v�g 10:115
> peter_e@gmx.net                   75262 Uppsala
> http://yi.org/peter-e/            Sweden
> 
> 
> 



pgsql-sql by date:

Previous
From: Howie
Date:
Subject: Re:[OT]-[SQL] manually set serial type
Next
From: Stephan Bauer
Date:
Subject: select with group by problem