Re: UNIX timestamps

From: "Scott Marlowe" <smarlowe(at)qwest(dot)net>
To: "Eduardo =?ISO-8859-1?Q?V=E1zquez_Rodr=EDguez?=" <evazquez(at)insys-corp(dot)com(dot)mx>
Cc: "Postgres (pgsql-novice(at)postgresql(dot)org)" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: UNIX timestamps
Date: 2004-07-29 07:28:48
Message-ID: 1091086128.27159.22.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, 2004-07-28 at 17:38, Eduardo Vázquez Rodríguez wrote:
> Hi everyone out there using Postgres
>
> Is there a data type or function in Postgres to handle UNIX
> timestamps?
>
> I have to handle datea in unix timestamp format like this
> 1079092862.453 and I would like to be inserted in human readable way
>
> Any suggestions are welcome

Do you need speed or precision?

For max speed, use an int4 and drop the non-integer part.

For good speed, use floats. They're pretty close and fair to middling
on performance.

For best precision, but slowest speeds, use numeric(18,3) or something
like that. Whatever the maximum size you have to deal with.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tobias Graf 2004-07-29 08:36:36 Moving DB von Postgresql 7.3 to 7.4
Previous Message Tom Lane 2004-07-29 00:34:26 Re: PQfnumber and duplicate column names....