Re: upgrading from 7.3.5 to 8.1.5

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank Bax <fbax(at)sympatico(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: upgrading from 7.3.5 to 8.1.5
Date: 2006-12-31 01:09:44
Message-ID: 25701.1167527384@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Frank Bax <fbax(at)sympatico(dot)ca> writes:
> 1) select and pg_dump produce different results. Why does .06 change to
> .0601 and .07 to .0699?

It's actually the same values --- remember that float4 is only good to
a bit over six decimal digits anyway. Post-7.3 versions of pg_dump set
"extra_float_digits" to provide a couple of guard digits in the output:

regression=# select 2006.18::real;
float4
---------
2006.18
(1 row)

regression=# set extra_float_digits TO 2;
SET
regression=# select 2006.18::real;
float4
-----------
2006.1801
(1 row)

On machines with properly-written floating point I/O, this ensures you
get back exactly the same float4 bit pattern you had stored before.
But it looks a bit funny, because the last digit is not "accurate"
in decimal terms.

> 2) age() changed from 7.3.5 to 8.1.5?

I see this in the 7.4.7 release notes:
Make age(timestamptz) do calculation in local timezone not GMT
It looks like the examples you cite are crossing DST boundaries, so
the one-hour difference is correct. Depending on what you are trying
to accomplish, you might wish to do the calculation in timestamp without
time zone.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Frank Bax 2006-12-31 05:21:38 Re: upgrading from 7.3.5 to 8.1.5
Previous Message Frank Bax 2006-12-30 23:04:56 upgrading from 7.3.5 to 8.1.5