Appearance
extra_float_digits (integer)
This parameter adjusts the number of digits displayed for floating-point values. The parameter value is added to the standard number of digits. 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.
For example, note the difference in query results against a REAL
column when extra_float_digits
is set to 3
versus 0
:
reset extra_float_digits;
create table extra_float as select avg_att::real from team where avg_att>0;
SELECT 20
select * from extra_float;
avg_att
---------
35.776
20.594
24.631
34.91
59.944
33.69
11.189
...
(20 rows)
set extra_float_digits to 3;
SET
create table extra_float_3 as select avg_att::real from team where avg_att>0;
SELECT 20
select * from extra_float_3;
avg_att
------------
35.776001
20.5939999
24.6310005
34.9099998
59.9440002
33.6899986
11.1890001
...
(20 rows)
See also real data types.