Re: data storage for timestamp data type? - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: data storage for timestamp data type?
Date
Msg-id 84A20856-3624-4ED1-9BCB-0FEA1801F904@seespotcode.net
Whole thread Raw
In response to data storage for timestamp data type?  (Chirag Patel <patelc75@yahoo.com>)
List pgsql-novice
[Please don't top post as it makes the discussion more difficult to
follow, and please reply to the list so that others may benefit from
and participate in the discussion.]

On Aug 14, 2007, at 14:38 , Chirag Patel wrote:

> Do you know how PostgreSQL stores the timestamp? The documentation
> indicates the following:
>
>         "timestamp values are stored as seconds before or after
> midnight 2000-01-01"
>
> I understand that PostgreSQL accepts the timestamp in string format
> ('2003-07-29 13:19:30.5'). But how is it actually stored? For
> example, if I use timestamp(3), then is it total number of
> milliseconds since "midnight 2000-01-01"?

Again, it depends on whether or not the server was compiled with
enable-integer-datetimes. If so, it's stored as microseconds from
midnight 2000-01-01 (in an int8). If not, it's stored as seconds from
midnight 2000-01-01 (in a float8).

Michael Glaesemann
grzm seespotcode net



pgsql-novice by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: data storage for timestamp data type?
Next
From: "Kevin McCarthy"
Date:
Subject: foreign key constraint to multiple tables