Re: Clarify: default precision on timestamps is 6 - Mailing list pgsql-docs

From Nathan Long
Subject Re: Clarify: default precision on timestamps is 6
Date
Msg-id CAOyE-6Z2cD+V5ro3sHLG-9O3axjY+_LG7HcMLOCjFWqYOsXZ9g@mail.gmail.com
Whole thread Raw
In response to Clarify: default precision on timestamps is 6  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Clarify: default precision on timestamps is 6
Next
From: Kirk Parker
Date:
Subject: Re: Clarify: default precision on timestamps is 6