Re: Unix timestamp , unix timestamp with microseconds

From: Richard Huxton <dev(at)archonet(dot)com>
To: "In(dot) Martin Prášek" <prasek(at)silesia(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Unix timestamp , unix timestamp with microseconds
Date: 2004-05-21 10:42:03
Message-ID: 40ADDCFB.2050907@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In. Martin Prášek wrote:
> I I read the documentation well (PG 7.3.3 ) , i see that there is not a native support for data type UNIX TIMESTAMP and "unix timestamp expressed as microseconds"
>
> ie there it is impossible to direct insert and select
>
> seconds_from _Epoch
> seconds_from _Epoch (period) microseconds_part
> seconds_from _Epochmicroseconds_part
>
> without some data conversion ?

You could use a numeric type if that's what you want - you'll want to
check the size but something like numeric(12,3) should do the job. Be
aware that numerics are much slower than int's though.

If you want separate access to the seconds/microsecs parts then you'll
need your define your own type - other people have done so, but you'll
need some knowledge of C.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-05-21 10:43:37 Re: Problem with public schema
Previous Message Richard Huxton 2004-05-21 10:38:26 Re: Web DB Management tool