Re: Clarify: default precision on timestamps is 6

From: Nathan Long <hello(at)nathanmlong(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Clarify: default precision on timestamps is 6
Date: 2023-10-13 14:54:22
Message-ID: CAOyE-6Z2cD+V5ro3sHLG-9O3axjY+_LG7HcMLOCjFWqYOsXZ9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Friday, October 13, 2023, PG Doc comments form <noreply(at)postgresql(dot)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.
>
>

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Kirk Parker 2023-10-13 17:24:14 Re: Clarify: default precision on timestamps is 6
Previous Message David G. Johnston 2023-10-13 14:32:02 Clarify: default precision on timestamps is 6