-<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.226 2009/09/10 15:02:46 alvherre Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.227 2009/09/11 19:17:03 tgl Exp $ -->
<chapter Id="runtime-config">
<title>Server Configuration</title>
floating-point values, including <type>float4</>, <type>float8</>,
and geometric data types. The parameter value is added to the
standard number of digits (<literal>FLT_DIG</> or <literal>DBL_DIG</>
- as appropriate). The value can be set as high as 2, to include
+ as appropriate). The value can be set as high as 3, to include
partially-significant digits; this is especially useful for dumping
float data that needs to be restored exactly. Or it can be set
negative to suppress unwanted digits.
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (ndig < 1)
ndig = 1;
- sprintf(ascii, "%.*g", ndig, num);
+ snprintf(ascii, MAXFLOATWIDTH + 1, "%.*g", ndig, num);
}
}
if (ndig < 1)
ndig = 1;
- sprintf(ascii, "%.*g", ndig, num);
+ snprintf(ascii, MAXDOUBLEWIDTH + 1, "%.*g", ndig, num);
}
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/geo_ops.c,v 1.104 2009/08/27 15:59:22 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/geo_ops.c,v 1.105 2009/09/11 19:17:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#define RDELIM_C '>'
/* Maximum number of characters printed by pair_encode() */
-/* ...+2+7 : 2 accounts for extra_float_digits max value */
-#define P_MAXLEN (2*(DBL_DIG+2+7)+1)
+/* ...+3+7 : 3 accounts for extra_float_digits max value */
+#define P_MAXLEN (2*(DBL_DIG+3+7)+1)
/*
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.516 2009/09/08 17:08:36 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.517 2009/09/11 19:17:03 tgl Exp $
*
*--------------------------------------------------------------------
*/
"(FLT_DIG or DBL_DIG as appropriate).")
},
&extra_float_digits,
- 0, -15, 2, NULL, NULL
+ 0, -15, 3, NULL, NULL
},
{
# India
# You can create your own file in
# share/timezonesets/.
-#extra_float_digits = 0 # min -15, max 2
+#extra_float_digits = 0 # min -15, max 3
#client_encoding = sql_ascii # actually, defaults to database
# encoding
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.546 2009/08/04 19:46:51 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.547 2009/09/11 19:17:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* 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 >= 70400)
+ if (g_fout->remoteVersion >= 80500)
+ 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");
/*