Re: [SQL] adding time to a datetime field ... how?

From: Margarit Nickolov <man(at)digsys(dot)bg>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: The Hermit Hacker <scrappy(at)hub(dot)org>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] adding time to a datetime field ... how?
Date: 1999-12-17 09:43:41
Message-ID: Pine.BSI.4.05L.9912171142560.11313-100000@developer.digsys.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 vg 10:115
> peter_e(at)gmx(dot)net 75262 Uppsala
> http://yi.org/peter-e/ Sweden
>
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Bauer 1999-12-17 13:11:53 select with group by problem
Previous Message Howie 1999-12-17 08:18:00 Re:[OT]-[SQL] manually set serial type