Michael Meskes <meskes@postgresql.org> writes:
> So here's the question comojng out of this all, anyone out here with an
> idea why the timestamp "Wed Jul 12 17:34:29 2000" becomes "Wed Jul 12
> 4649:34:26.000002 2000" when putting it into timestamp format and back
> out. The function is almost identical to timestamp_in resp.
> timestamp_out. If these two functions and their helpers are compield
> without "-O2" the output is correct.
FWIW, I get the correct answer in CVS tip on Red Hat Linux 8.0, which
is using gcc 3.2 (and -O2, per defaults in our makefiles):
regression=# set DateStyle TO postgres;
SET
regression=# select 'Wed Jul 12 17:34:29 2000'::timestamp; timestamp
--------------------------Wed Jul 12 17:34:29 2000
(1 row)
regards, tom lane