Re: pg_upgrade and extra_float_digits

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade and extra_float_digits
Date: 2010-05-16 13:54:01
Message-ID: 201005161354.o4GDs1b27420@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:
>
>
> Bruce Momjian wrote:
> >>
> >> Maybe I have misunderstood. How exactly is the server version being
> >> hacked here? I know it's only for testing, but it still seems to me that
> >> lying to a program as heavily version dependant as pg_dump is in general
> >> a bad idea.
> >>
> >
> > The code in pg_dump 9.0 is:
> >
> > /*
> > * If supported, set extra_float_digits so that we can dump float data
> > * exactly (given correctly implemented float I/O code, anyway)
> > */
> > if (g_fout->remoteVersion >= 90000)
> > do_sql_command(g_conn, "SET extra_float_digits TO 3");
> > else if (g_fout->remoteVersion >= 70400)
> > --> do_sql_command(g_conn, "SET extra_float_digits TO 2");
> >
> > The indicated line had to be changed to '3'. I did not change anything
> > else, and it was only done in my private CVS tree.
> >
> >
>
> Oh, I see. It is pg_dump that you hacked. That wasn't clear to me from
> what you first said.
>
> But do earlier server versions accept a value of 3? The 8.4 docs say
> "The value can be set as high as 2".

That is the other thing I had to hack --- the 8.4 backend version had to
be changed to accept '3'. The good thing is this has to be done only
once --- once I have the dump file, I can use it in testing repeatedly
because 8.4 does not change.

Eventually the idea would be to have the build farm run such tests (with
a properly created dump file) so we can learn quickly if the backend
data format is changed.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-05-16 15:31:06 Re: pg_upgrade and extra_float_digits
Previous Message Joachim Wieland 2010-05-16 13:49:49 Re: Patch for PKST timezone