Re: [HACKERS] [PATCH] Fix for documentation of timestamp type

Поиск
Список
Период
Сортировка
Искать

Re: [HACKERS] [PATCH] Fix for documentation of timestamp type

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Mon, Dec 12, 2016 at 8:50 AM, Aleksander Alekseev
 wrote:
> I suggest to rewrite the documentation a bit to make it more clear that
> by default timestamp is stored in microseconds. Corresponding patch is
> attached.

I find this a bit unclear, because the revised text kind of jumps back
and forth between the floating-point and integer formats.  Perhaps
something like this:
   When 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 timestamp</> values are   stored as double precision floating-point numbers instead (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 timestamp values to be represented than   shown above: from 4713 BC up to 5874897 AD.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [HACKERS] [PATCH] Fix for documentation of timestamp type

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Robert Haas  writes:
> I find this a bit unclear, because the revised text kind of jumps back
> and forth between the floating-point and integer formats.  Perhaps
> something like this:

Your wording seems OK to me, although I'd drop the "instead".
		regards, tom lane


Re: [HACKERS] [PATCH] Fix for documentation of timestamp type

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Tue, Dec 13, 2016 at 10:41 AM, Tom Lane  wrote:
> Robert Haas  writes:
>> I find this a bit unclear, because the revised text kind of jumps back
>> and forth between the floating-point and integer formats.  Perhaps
>> something like this:
>
> Your wording seems OK to me, although I'd drop the "instead".

Good idea.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [HACKERS] [PATCH] Fix for documentation of timestamp type

От:
Cynthia Shang <cynthia.shang@crunchydata.com>
Дата:
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 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 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 timestamp values to be represented than shown above: from 4713 BC up to 5874897 AD.

Thanks,
-Cynthia

Re: [HACKERS] [PATCH] Fix for documentation of timestamp type

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Tue, Dec 13, 2016 at 10:46 AM, Robert Haas  wrote:
> On Tue, Dec 13, 2016 at 10:41 AM, Tom Lane  wrote:
>> Robert Haas  writes:
>>> I find this a bit unclear, because the revised text kind of jumps back
>>> and forth between the floating-point and integer formats.  Perhaps
>>> something like this:
>>
>> Your wording seems OK to me, although I'd drop the "instead".
>
> Good idea.

Committed.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


FAQ