1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Increase the maximum value of extra_float_digits to 3, and have pg_dump

use that value when the backend is new enough to allow it.  This responds
to bug report from Keh-Cheng Chu pointing out that although 2 extra digits
should be sufficient to dump and restore float8 exactly, it is possible to
need 3 extra digits for float4 values.
This commit is contained in:
Tom Lane
2009-09-11 19:17:04 +00:00
parent 680bf3268c
commit 8c5463a511
6 changed files with 15 additions and 13 deletions
doc/src/sgml
src

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.162 2009/06/11 14:49:03 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.163 2009/09/11 19:17:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -334,7 +334,7 @@ float4out(PG_FUNCTION_ARGS)
if (ndig < 1)
ndig = 1;
sprintf(ascii, "%.*g", ndig, num);
snprintf(ascii, MAXFLOATWIDTH + 1, "%.*g", ndig, num);
}
}
@ -523,7 +523,7 @@ float8out(PG_FUNCTION_ARGS)
if (ndig < 1)
ndig = 1;
sprintf(ascii, "%.*g", ndig, num);
snprintf(ascii, MAXDOUBLEWIDTH + 1, "%.*g", ndig, num);
}
}