diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-09-11 19:17:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-09-11 19:17:04 +0000 |
commit | 8c5463a51176c8d2a01fcf154d7ac33fa9a74f6a (patch) | |
tree | 9e8efe691f08fe96df16ef954ed7934885c4b9a7 /src/backend/utils/adt/float.c | |
parent | 680bf3268c91d188c018470491ce6ab146960b28 (diff) | |
download | postgresql-8c5463a51176c8d2a01fcf154d7ac33fa9a74f6a.tar.gz postgresql-8c5463a51176c8d2a01fcf154d7ac33fa9a74f6a.zip |
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.
Diffstat (limited to 'src/backend/utils/adt/float.c')
-rw-r--r-- | src/backend/utils/adt/float.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 4547240be1f..d30fcc01632 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -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); } } |