Re: bug in current_timestamp(1) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bug in current_timestamp(1)
Date
Msg-id 9894.1059576515@sss.pgh.pa.us
Whole thread Raw
In response to bug in current_timestamp(1)  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Going from precision 3 down to 0 - note the bug in (1).  It always displays
> a trailing zero.

It's not a bug, it's a feature, or at least Tom Lockhart once thought so.
See TrimTrailingZeros() in datetime.c:   /* chop off trailing zeros... but leave at least 2 fractional digits */

I don't recall the history behind that choice, and I'm disinclined to
mess with it without knowing why it was set up to do that.  I have a
feeling it might have something to do with compatibility with some
non-Postgres code.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: using adbin, conbin, etc.
Next
From: Andrew Dunstan
Date:
Subject: Re: Feature request -- Log Database Name