Re: Conversion

From: "Alexander M(dot) Pravking" <fduch(at)antar(dot)bryansk(dot)ru>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Lonh SENG <slonh(at)camgsm(dot)com(dot)kh>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Conversion
Date: 2002-08-13 07:37:13
Message-ID: 20020813073713.GB91244@dyatel.antar.bryansk.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Aug 13, 2002 at 03:14:38PM +0800, Christopher Kings-Lynne wrote:
> > http://www.postgresql.org/idocs/index.php?datatype-datetime.html says:
> >
> > 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.
>
> Yes, but in absence of:
>
> SELECT EXTRACT(TIMESTAMP FROM EPOCH '12341234234');

Sounds nice :)

> (Hint Hint Thomas!!!)
>
> It's all he can do. I suggest using the syntax above to convert his integer
> column to a timestamp column.

Sure. I use the same. But I don't like it because of that caution :(

The other way is
SELECT 'epoch'::timestamp + (int4field::text || 's')::interval,
but it's much much slower... And it seems not to handle timestamps
after 2038-01-19.

--
Fduch M. Pravking

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Wei Weng 2002-08-13 14:27:28 Re: Is this valid?
Previous Message Christopher Kings-Lynne 2002-08-13 07:31:50 Re: Function error