Re: Timestamp with precision output format with trailing zeros

From: ewie(at)mailbox(dot)org
To: Eugene Podshivalov <yaugenka(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Timestamp with precision output format with trailing zeros
Date: 2022-01-08 06:22:19
Message-ID: 644001932.1297304.1641622939049@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Eugene,

> > # select '2022-01-06 18:00:00.000+03'::timestamptz(3);
> > timestamptz
> > ------------------------
> > 2022-01-06 18:00:00+03
> Would it be more correct to output zero milliseconds if the column has
> precision defined?

Only significant fractional are printed, e.g. with milliseconds > 0:

# select '2022-01-06 18:00:00.001+03'::timestamptz(3);
timestamptz
----------------------------
2022-01-06 16:00:00.001+01

I don't know if omitting trailing zeros is intended but it makes sense to
me.

Erik

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alicja Kucharczyk 2022-01-08 07:10:53 create database hangs forever on WSL - autovacuum deadlock?
Previous Message Michael Paquier 2022-01-08 06:04:50 Re: md5 issues Postgres14 on OL7