On Fri, Oct 13, 2023 at 7:32 AM David G. Johnston < david.g.johns...@gmail.com> wrote:
> On Friday, October 13, 2023, PG Doc comments form <nore...@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. > > Not sure that last statement is correct. In 13 (only system I have access to at the moment) it doesn't look like casting to a precision greater than the value originally had causes any padding: some_system=# select CURRENT_TIMESTAMP(0)::timestamp(6) with time zone; current_timestamp ------------------------ 2023-10-13 17:19:00+00 (1 row) some_system=# select CURRENT_TIMESTAMP(1)::timestamp(6) with time zone; current_timestamp -------------------------- 2023-10-13 17:23:04.2+00 (1 row)