Re: internal time format

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: justin <jtyme(at)intrusic(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: internal time format
Date: 2003-04-14 21:23:17
Message-ID: 15774.1050355397@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

justin <jtyme(at)intrusic(dot)com> writes:
> I'm generating binary copy files and was wondering if someone could quickly
> shed some light on the internal binary format used to represent time types,
> specifically timestamp{w/tz} types.

It's usually a float8, but an int8 if you built with
--enable-integer-datetimes. IIRC, the float8 represents seconds
before/since midnight 1/1/2000, the int8 the same but multiplied by
10^6. For timestamptz the reference is midnight GMT, for timestamp
it's, uh, just midnight ...

> pointers to which source files and/or routines to look at would
> be sufficient.

The date and time related files in src/backend/utils/adt/ are what
to look at.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-04-14 22:37:57 Are we losing momentum?
Previous Message cbbrowne 2003-04-14 20:56:45 Re: Anyone working on better transaction locking?