Re: timestamp format bug - Mailing list pgsql-hackers

From Roberts, Jon
Subject Re: timestamp format bug
Date
Msg-id 1A6E6D554222284AB25ABE3229A92762715526@nrtexcus702.int.asurion.com
Whole thread Raw
In response to Re: timestamp format bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: timestamp format bug  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: timestamp format bug  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Thursday, January 31, 2008 10:48 AM
> To: Kevin Grittner
> Cc: Roberts, Jon; pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] timestamp format bug
>
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> > On Thu, Jan 31, 2008 at  9:34 AM, in message
> >
<1A6E6D554222284AB25ABE3229A92762715521@nrtexcus702.int.asurion.com>,
> "Roberts,
> > Jon" <Jon.Roberts@asurion.com> wrote:
> >> These two fields should be consistent because they should be
formatted
> >> the same way.
>
> > Why would you think that?
>
> Indeed the whole *point* of to_char() is to display the value in a
> different format than the type's standard output converter would use.
>
> I think it'd be a reasonable complaint that to_char() offers no way
> to control how many fractional-second digits you get in its output;
> but that's a missing feature not a bug.
>
> > I can think of a couple database products which only go to three
> > decimal positions, and always show three, but that's hardly a
> > standard.
>
> Considering that to_char() is intended to be compatible with *r*cl*e,
> if that's what they do then we may be stuck with doing the same.
>


No, Larry's company doesn't round the zeros off for timestamp or date
data types and not round off the zeros for character conversions.  That
vendor leaves the trailing zeros for both.

If not to_char, what is the preferred method to convert a timestamp to a
string?



Jon


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: timestamp format bug
Next
From: "Kevin Grittner"
Date:
Subject: Re: timestamp format bug