Re: [HACKERS] Compiling 6.4 on NetBSD-current/pc532 - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] Compiling 6.4 on NetBSD-current/pc532
Date
Msg-id 35FC7CCD.C2A58A2E@alumni.caltech.edu
Whole thread Raw
In response to Compiling 6.4 on NetBSD-current/pc532  (Jon Buller <jonb@metronet.com>)
Responses Re: [HACKERS] Also on SVR4 (Compiling 6.4 on NetBSD-current/pc532)  (Frank Ridderbusch <ridderbusch.pad@sni.de>)
Re: [HACKERS] Compiling 6.4 on NetBSD-current/pc532  (Jon Buller <jonb@metronet.com>)
List pgsql-hackers
> I have a current version of PostgreSQL running on my pc532 now.
> (It's a NS32K based machine.  Somewhat of an antique really...)
> It did not, however, get the datetime test correct.
> ... I suspect (a NetBSD/pc532 problem) due to a lack of people
> screaming.

Screaming means you get to help do development :)

> I did build 6.3.2 with -DDATEDEBUG, but I'm not coherent enough
> (yet?) to properly deduce anything yet.  It appeared to all be
> correct until it printed the results, implying that libc or a
> syscall was returning some funny constant perhaps?

Ah. It's slowly coming back to me, so here are some suggestions:

"epoch" and "current" are stored internally in the database so that the
support code can pull one back out and say "oh! that's supposed to be
'epoch'", for example. So, I used _very_ small floating point numbers to
represent those special constants (numbers much smaller than one could
get by doing the usual arithmetic, at least under normal circumstances).

I'll bet that your machine is somehow pushing those numbers to be
exactly zero, which corresponds to Y2K (with the timezone offset, that
is what you are seeing). So, try looking at the numbers, and try seeing
what they are being set to. In src/include/utils/dt.h, you will see that
current and epoch are being set to DBL_MIN and -DBL_MIN, respectively.
Make sure that these are not identical to zero (they are something like
1e-308 on my machine). You can change dt.h to make these some other
usually unique number, say +/-1e-20 for now.

And track down why DBL_MIN on your machine isn't the smallest allowed
double-precision number...

                    - Tom

pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] Missing headers Windows NT port
Next
From: Oleg Bartunov
Date:
Subject: Re: [HACKERS] AbortTransaction and not in in-progress state