Обсуждение: Re: [HACKERS] Timestamp, fractional seconds problem

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

Re: [HACKERS] Timestamp, fractional seconds problem

От
Barry Lind
Дата:
Thomas,

Can you explain more how this functionality has changed?  I know that in
the JDBC driver fractional seconds are assumed to be two decimal places.
  If this is no longer true, I need to understand the new symantics so
that the JDBC parsing routines can be changed.  Other interfaces may
have similar issues.

thanks,
--Barry

Thomas Lockhart wrote:

>>Problem: the external representation of time and timestamp are
>>          less precise than the internal representation.
>>
>
> Fixed (as of yesterday) in the upcoming release.
>
>                        - Thomas
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>



Re: [HACKERS] Timestamp, fractional seconds problem

От
Thomas Lockhart
Дата:
> Can you explain more how this functionality has changed?  I know that in
> the JDBC driver fractional seconds are assumed to be two decimal places.
>   If this is no longer true, I need to understand the new symantics so
> that the JDBC parsing routines can be changed.  Other interfaces may
> have similar issues.

OK. (Remember that the new behaviors can be changed if this doesn't work
for you).

Formerly, all times had either zero or two fractional decimal places.
Now, times are explicitly truncated to their defined precision at a few
specific points in processing (e.g. when reading a literal constant or
when storing into a column). At all other points in processing, the
values are allowed to take on whatever fractional digits might have come
from math operations or whatever.

The output routines now write the maximum number of fractional digits
reasonably present for a floating point number (10 for time, should be
but isn't less for timestamp) and then trailing zeros are hacked out,
two digits at a time.

The regression tests produced basically the same results as always, once
the time and timestamp columns were defined to be "time(2)" or
"timestamp(2)".

But there is definitely the possibility of more precision than before in
the output string for time fields.

                       - Thomas