Thread: Re(2): Re(2): 7.0.3 BUG

Re(2): Re(2): 7.0.3 BUG

From
"pgsql-sql"
Date:
tgl@sss.pgh.pa.us writes:
>"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?

Yes, I'm very sure. 
About the dump file, I made manual changes to all timestamp 
containing "00:00:60.00+08" (changed it to "00:00:00.00+08").
I did this because....
migrate=# select version();                           version
---------------------------------------------------------------PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc
2.95.3
(1 row)

migrate=# select '2000-01-05 00:00:60.00+08'::timestamp;
ERROR:  Bad timestamp external representation '2000-01-05 00:00:60.00+08'
migrate=# select '2000-01-05 00:00:00.00+08'::timestamp;        ?column?
---------------------------2000-01-05 00:00:60.00+08
(1 row)


Is there a work-around to this aside from manually changing the dump file?
>
>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)?  

Distribution Version:          Linux Mandrake release 7.2 (Odyssey) for
i586
Operating System Version:      #1 Thu Oct 5 13:16:08 CEST 2000
Operating System Release:      2.2.17-21mdk
Processor Type:                i686

>Where and how did you obtain
>your Postgres files; if you compiled them yourself, how did you
>configure and compile?

It was shipped with Mandrake-Linux 7.2
>
>> 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?

We can be sure that the compiler is relatively bug free because it was
used to recompile the entire Linux distribution...
>

sherwin
>








Re: Re(2): Re(2): 7.0.3 BUG

From
Alain Toussaint
Date:
> >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.

quick tidbit,there's no gcc 2.95.3 from GCC's but there's is one from
Pentium gcc (see <http://goof.com/pcg/> ),the pentium gcc group in this
case used gcc 2.95.2,applied their pentium patches and released the thing
as pgcc 2.95.3,that's the stock compiled used by mandrake.

Alain Toussaint



Re: 7.0.3 BUG

From
Thomas Lockhart
Date:
> >> 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().
...
> Is there a work-around to this aside from manually changing the dump file?
> Distribution Version:          Linux Mandrake release 7.2 (Odyssey) for
> i586
> It was shipped with Mandrake-Linux 7.2
> >> migrate=# select version();
> >>                             version
> >> ---------------------------------------------------------------
> >>  PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.3
...
> We can be sure that the compiler is relatively bug free because it was
> used to recompile the entire Linux distribution...

Ah ha (or rather, ha ha ha)! I'd suggest using the RPMs posted on the
postgresql.org ftp site, which include a sample .rpmrc file which fixes
disasterous bugs in Mandrake's default compiler settings for building
RPMs. Specifically, Mandrake sets the -ffast-math flag, which the gcc
folks warn is not compatible with -On optimizations. When I build RPMs I
kill the fast-math option, and the rounding troubles go away.

The rounding trouble does not show up on other platforms or Linux
distros because no one else ignores the gcc recommendations to this
extent :(
                     - Thomas