pgsql: Fix (hopefully for the last time) problems with datetime values
Log Message:
-----------
Fix (hopefully for the last time) problems with datetime values displaying
like '23:59:60' because of fractional-second roundoff problems. Trying
to control this upstream of the actual display code was hopeless; the right
way is to explicitly round fractional seconds in the display code and then
refigure the results if the fraction rounds up to 1. Per bug #1927.
Modified Files:
--------------
pgsql/src/interfaces/ecpg/pgtypeslib:
dt.h (r1.31 -> r1.32)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/pgtypeslib/dt.h.diff?r1=1.31&r2=1.32)
dt_common.c (r1.29 -> r1.30)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c.diff?r1=1.29&r2=1.30)
interval.c (r1.28 -> r1.29)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/pgtypeslib/interval.c.diff?r1=1.28&r2=1.29)
timestamp.c (r1.31 -> r1.32)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/pgtypeslib/timestamp.c.diff?r1=1.31&r2=1.32)
pgsql/contrib/btree_gist:
btree_ts.c (r1.10 -> r1.11)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/btree_gist/btree_ts.c.diff?r1=1.10&r2=1.11)
pgsql/src/backend/utils/adt:
date.c (r1.120 -> r1.121)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/date.c.diff?r1=1.120&r2=1.121)
datetime.c (r1.157 -> r1.158)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/datetime.c.diff?r1=1.157&r2=1.158)
timestamp.c (r1.153 -> r1.154)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/timestamp.c.diff?r1=1.153&r2=1.154)
pgsql/src/include/utils:
date.h (r1.30 -> r1.31)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/date.h.diff?r1=1.30&r2=1.31)
timestamp.h (r1.55 -> r1.56)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/timestamp.h.diff?r1=1.55&r2=1.56)
On Sun, Oct 09, 2005 at 02:21:47PM -0300, Tom Lane wrote:
Fix (hopefully for the last time) problems with datetime values displaying
like '23:59:60' because of fractional-second roundoff problems. Trying
to control this upstream of the actual display code was hopeless; the right
way is to explicitly round fractional seconds in the display code and then
refigure the results if the fraction rounds up to 1. Per bug #1927.
This change causes my FreeBSD 4.11-STABLE box and a couple of FreeBSD 6
members of the buildfarm to fail while building ecpg:
timestamp.c: In function `timestamp2tm':
timestamp.c:195: `INT_MAX' undeclared (first use in this function)
Including <limits.h> in src/interfaces/ecpg/pgtypeslib/timestamp.c
fixes the problem.
--
Michael Fuhr
On Oct 9, 2005, at 1:56 PM, Michael Fuhr wrote:
On Sun, Oct 09, 2005 at 02:21:47PM -0300, Tom Lane wrote:
Fix (hopefully for the last time) problems with datetime values
displaying
like '23:59:60' because of fractional-second roundoff problems.
Trying
to control this upstream of the actual display code was hopeless;
the right
way is to explicitly round fractional seconds in the display code
and then
refigure the results if the fraction rounds up to 1. Per bug #1927.This change causes my FreeBSD 4.11-STABLE box and a couple of
FreeBSD 6
members of the buildfarm to fail while building ecpg:timestamp.c: In function `timestamp2tm':
timestamp.c:195: `INT_MAX' undeclared (first use in this function)Including <limits.h> in src/interfaces/ecpg/pgtypeslib/timestamp.c
fixes the problem.
firefly (my UnixWare box as well) dies with this.
LER
--
Michael Fuhr---------------------------(end of
broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-351-4152 E-Mail: ler@lerctr.org
US Mail: 3535 Gaspar Drive, Dallas, TX 75220-3611
On Sun, Oct 09, 2005 at 03:43:20PM -0500, Larry Rosenman wrote:
On Oct 9, 2005, at 1:56 PM, Michael Fuhr wrote:
This change causes my FreeBSD 4.11-STABLE box and a couple of
FreeBSD 6 members of the buildfarm to fail while building ecpg:timestamp.c: In function `timestamp2tm':
timestamp.c:195: `INT_MAX' undeclared (first use in this function)Including <limits.h> in src/interfaces/ecpg/pgtypeslib/timestamp.c
fixes the problem.firefly (my UnixWare box as well) dies with this.
When you say "firefly dies with this," which "this" are you referring
to? The original change, my suggestion to include <limits.h>, or both?
At least the first, apparently:
http://pgbuildfarm.org/cgi-bin/show_log.pl?nm=firefly&dt=2005-10-09%2020:27:01
My Solaris 9 box also failed with the original change.
--
Michael Fuhr
Michael Fuhr <mike@fuhr.org> writes:
timestamp.c: In function `timestamp2tm':
timestamp.c:195: `INT_MAX' undeclared (first use in this function)
Including <limits.h> in src/interfaces/ecpg/pgtypeslib/timestamp.c
fixes the problem.
Oops, fixed. Thanks for the report.
regards, tom lane