Re: Clarify: default precision on timestamps is 6

Поиск
Список
Период
Сортировка
От Nathan Long
Тема Re: Clarify: default precision on timestamps is 6
Дата
Msg-id CAOyE-6Z2cD+V5ro3sHLG-9O3axjY+_LG7HcMLOCjFWqYOsXZ9g@mail.gmail.com
обсуждение исходный текст
Ответ на Clarify: default precision on timestamps is 6  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
The expected behavior was not obvious to me. "By default, there is no explicit bound on precision" sounds more like "unlimited variable length", as on the 'text' character type.

"By default, the bound on precision is 6 (that is, microsecond precision)" conveys that 'timestamp with timezone' means exactly the same as 'timestamp(6) with timezone', which my experiments indicate is the case, but which was unclear to me, as was the expected behavior around rounding and padding or lack thereof.

-- Nathan

On Fri, Oct 13, 2023 at 10:32 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Friday, October 13, 2023, PG Doc comments form <noreply@postgresql.org> wrote:
both of them round any precision
beyond microseconds, and neither returns timestamps with greater precision
than the value that was inserted.

That is precisely what a no default with maximum of six means.  If we say the default is six that would imply storage of less precise values pads significant zeros until there are six.

David J.
 

В списке pgsql-docs по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Clarify: default precision on timestamps is 6
Следующее
От: Kirk Parker
Дата:
Сообщение: Re: Clarify: default precision on timestamps is 6