Skip site navigation (1) Skip section navigation (2)

Fix for timestamp rouding

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Fix for timestamp rouding
Date: 2005-05-26 18:18:08
Message-ID: 200505261818.j4QII8R27135@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Michael Fuhr wrote:
> I'm getting time, timetz, and horology regression failures in HEAD
> on Solaris 9 / gcc 3.4.2.  So are other machines in the build farm,
> such as this one:
> 
> http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=shark&dt=2005-05-26%2004:21:00
> 
> I'm getting the same regression failures shown in that link; here's
> an example:

OK, I have a new patch, which simplifies the code by using
TrimTrailingZeros(), gives more consistent subsecond display, and
subpresses the rounding problem:


	test=> select '2005 years 4 mons 20 days 15 hours 57 mins 12.1 secs ago'::interval;
	                 interval
	-------------------------------------------
	 -2005 years -4 mons -20 days -15:57:12.10
	(1 row)
	
	test=> select '2005 years 4 mons 20 days 15 hours 57 mins 12.13 secs ago'::interval;
	                 interval
	-------------------------------------------
	 -2005 years -4 mons -20 days -15:57:12.13
	(1 row)
	
	test=> select '2005 years 4 mons 20 days 15 hours 57 mins 12.134 secs ago'::interval;
	                  interval
	--------------------------------------------
	 -2005 years -4 mons -20 days -15:57:12.134
	(1 row)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-05-26 18:46:31
Subject: Re: Fix for timestamp rouding
Previous:From: Junaili LieDate: 2005-05-26 18:10:53
Subject: Re: postmaster.pid disappeared

pgsql-patches by date

Next:From: Tom LaneDate: 2005-05-26 18:46:31
Subject: Re: Fix for timestamp rouding
Previous:From: Tom LaneDate: 2005-05-26 17:50:25
Subject: Re: Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group