Re: [PATCH] Fix for documentation of timestamp type

From: Cynthia Shang <cynthia(dot)shang(at)crunchydata(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Subject: Re: [PATCH] Fix for documentation of timestamp type
Date: 2016-12-28 16:41:42
Message-ID: 20161228164142.32165.57427.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The latest patch attachment has a couple typos in it ("storead" instead of "stored"). I interpreted the final suggestion in the thread to mean 1) default stores in microseconds 2) deprecated compile-time option stores as seconds. If these assumptions are correct then the suggestion in the thread (minus "instead" as Tom suggested) provided below should be incorporated and attached as a patch to this thread. Therefore I recommend an "Awaiting Author" status.

When <type>timestamp</> values are stored as eight-byte integers (currently the default), microsecond precision is available over the full range of values. In this case, the internal representation is the number of microseconds before or after midnight 2000-01-01. When <type>timestamp</> values are stored as double precision floating-point numbers (a deprecated compile-time option), the internal representation is the number of seconds before or after midnight 2000-01-01. With this representation, the effective limit of precision might be less than 6; in practice, microsecond precision is achieved for dates within a few years of 2000-01-01, but the precision degrades for dates further away. Note that using floating-point datetimes allows a larger range of <type>timestamp</type> values to be represented than shown above: from 4713 BC up to 5874897 AD.

Thanks,
-Cynthia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2016-12-28 16:43:18 Re: Hooks
Previous Message Andres Freund 2016-12-28 16:37:39 Re: Duplicate node tag assignments