Re: Frustration with date/times/epoch in v7.3.

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Mike Benoit <mikeb(at)netnation(dot)com>
Cc: Peter Gibbs <peter(at)emkel(dot)co(dot)za>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Frustration with date/times/epoch in v7.3.
Date: 2002-12-12 21:52:42
Message-ID: 20021212134307.I11714-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 12 Dec 2002, Mike Benoit wrote:

> Thanks Peter, abstime() seems to do the trick. However this paragraph
> from the docs worries me:
>
> "The types abstime and reltime are lower precision types which are used
> internally. You are discouraged from using any of these types in new
> applications and are encouraged to move any old ones over when
> appropriate. Any or all of these internal types might disappear in a
> future release."
>
> So does this mean that the abstime() functions may dissappear in the
> future? I'd rather not have to go through and change all my queries yet
> again, is there a function that has a better chance of being around in
> the near future that I could use instead?

Actually, you were already using the existance of abstime in 7.2.
The base issue that I believe caused the change is that int4->abstime used
to be able to be used as an implicit cast and then the abstime could be
used as an argument to timestamp(abstime) but now the cast is only
allowed if used explicitly.

You're probably best off wrapping it in a function "timestamp"(int) for
now (probably just 'select "timestamp"($1::abstime);') as that way you're
somewhat isolated from changes as long as there's a way to do the
conversion (and it's possible that timestamp(int) will do what you want
in the future again, since I'm not sure this was an intended consequence).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Williams, Travis L, NPONS 2002-12-12 21:56:24 Grant question..
Previous Message Mike Benoit 2002-12-12 21:44:32 Re: Frustration with date/times/epoch in v7.3.