From: Margarit Nickolov <man@digsys.bg>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: The Hermit Hacker <scrappy@hub.org>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] adding time to a datetime field ... how?
Date: Fri, 17 Dec 1999 11:43:41 +0200 (EET)
Message-ID: <Pine.BSI.4.05L.9912171142560.11313-100000@developer.digsys.bg> (raw)
In-Reply-To: <Pine.LNX.4.21.9912161925010.5199-100000@localhost.localdomain>
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
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: man@digsys.bg, peter_e@gmx.net, scrappy@hub.org
Subject: Re: [SQL] adding time to a datetime field ... how?
In-Reply-To: <Pine.BSI.4.05L.9912171142560.11313-100000@developer.digsys.bg>
References: <Pine.LNX.4.21.9912161925010.5199-100000@localhost.localdomain> <Pine.BSI.4.05L.9912171142560.11313-100000@developer.digsys.bg>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox