Re: [PATCHES] guc - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCHES] guc
Date
Msg-id Pine.LNX.4.30.0201171722530.725-100000@peter.localdomain
Whole thread Raw
Responses Re: [PATCHES] guc
List pgsql-hackers
Liam Stewart writes:

> I've removed
> GetConfigOption() and replaced it with ShowConfigOption() which does an
> elog(NOTICE) instead of returning a string.

I certainly don't like that.  I want to be able to get at the
configuration setting without any notice going off.

> When setting REAL_FORMAT and DOUBLE_PRECISION_FORMAT, the printf-style
> format string should be checked for certain things:

I wouldn't use a printf format string at all.  It's not user-friendly --
not everyone is a C programmer, in fact most people aren't.  It leaves
open too many ways to shoot yourself in the foot.  And if you plan to
close all those ways you end up with a crippled system that is still
complex to understand for many.

What I would like to get out of the configurability of floating-point
numbers is:

1. The ability to dump them in binary or hex format for lossless  dump/reload.  (printf("%a") does that.)  That could
bea boolean  setting.
 

2. To have (at least as an option) the same output format on all platforms.  Not sure how to approach that, perhaps it
hasnothing to do with  configurability.
 

Some people will also suggest

3. Be able to set the number of significant digits that are shown.

to allow simplifying the regression tests, but I do not think that that is
a good idea, because

a. If platforms behave differently, the test suite should not paint over  that; it might be important information.

b. If we actually break floating-point operations one day, we might miss  it.

c. Types represent data, data is altered by functions (round? truncate?).  Global side-effects are evil.

d. Input and output would not be inverses anymore.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug in pg_dump/restore -o
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] guc