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.
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);
}
}
#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)
/*
"(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
* 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");
/*