Tom Lane wrote:
> BTW, did you check to see if this affects the geometric types or not?
> I am not sure that they go through float8out; they may need similar
> adjustments in their output routines.
In fact they need adjustments.
The *_out routines (in src/backend/utils/adt/geo_ops.c) for the
geometric types rely on two functions to output data:
static int pair_encode(float8 x, float8 y, char *str);
static int single_encode(float8 x, char *str);
These functions produce output with (for pair_encode):
sprintf(str, "%.*g,%.*g", digits8, x, digits8, y);
digits8 is defined as ,
#define P_MAXDIG DBL_DIG
static int digits8 = P_MAXDIG;
I think it would be done the same way as for float4_out and float8_out:
extern int extra_float_digits;
int
ndig = digits8 + extra_float_digits;
if (ndig < 1)ndig = 1;
sprintf(str, "%.*g,%.*g", ndig, x, ndig, y);
There a bunch of other places where output is produced. They are all
within #ifdef GEODEBUG / #enfif blocks. Should these be corrected the
same way ?
Regards,
Pedro