From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-sql <pgsql-sql@fc.emc.com.ph>
To: Thomas Lockhart <lockhart@alumni.caltech.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: Re(2): 7.0.3 BUG
Date: Sat, 25 Nov 2000 11:28:58 -0500
Message-ID: <568.975169738@sss.pgh.pa.us> (raw)
In-Reply-To: <fc.000f567200818c73000f567200818c73.818c7f@fc.emc.com.ph>
References: <fc.000f567200818c73000f567200818c73.818c7f@fc.emc.com.ph>
"pgsql-sql" <pgsql-sql@fc.emc.com.ph> writes:
> ERROR: copy: line 3910, Bad timestamp external representation '2000-01-05
> 00:00:60.00+08'
> Weird because those timestamps were generated by default now().
Weird, all right. I can get 7.0.2 to emit an incorrect representation
like that by constructing a fractional-second value that needs to be
rounded off:
play=> set TimeZone TO 'GMT-8';
SET VARIABLE
play=> select '2000-01-05 00:00:59.00+08'::timestamp + '0.999 sec'::interval;
?column?
---------------------------
2000-01-05 00:00:60.00+08
(1 row)
That's clearly a bug. Evidently the rounding to 2 fractional digits
needs to be done before we start conversion, not at the end, since in
the worst case the effects could need to propagate all the way to the
displayed year.
However, that shouldn't matter for now() results, because AFAIK now()
results should always be exact integer seconds. Are you sure you
weren't doing arithmetic on these values somewhere along the line?
In any case, I'm pretty sure nothing's changed in the timestamp code
between 7.0.2 and 7.0.3, and I know of no changes that could explain
your original report either. I'm not sure why your update went so
disastrously --- I'm wondering about possibilities like a corrupted
download of Postgres. What platform are you on (I think you said Linux,
but which release of which distro)? Where and how did you obtain
your Postgres files; if you compiled them yourself, how did you
configure and compile?
> migrate=# select version();
> version
> ---------------------------------------------------------------
> PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.3
That's a rather interesting version report, seeing as how there is
no such gcc release as 2.95.3 according to the GCC project's homepage.
What compiler are you using exactly, and what confidence do you have
that it's bug-free? You wouldn't be using that known-unstable gcc
that RedHat shipped in their 7.0, would you?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-sql@fc.emc.com.ph, lockhart@alumni.caltech.edu
Subject: Re: 7.0.3 BUG
In-Reply-To: <568.975169738@sss.pgh.pa.us>
References: <fc.000f567200818c73000f567200818c73.818c7f@fc.emc.com.ph> <568.975169738@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox