I have a table with a column named total
having the real
data type.
But I'm finding that this column is being rounded when I query its value, as illustrated in the following:
SELECT total FROM data WHERE id='xe54g';
total
---------
105861
UPDATE data SET total=105860.5 WHERE id='xe54g';
UPDATE 1
SELECT total FROM data WHERE id='xe54g';
total
---------
105860
UPDATE data SET total=105860.7 WHERE id='xe54g';
UPDATE 1
SELECT total FROM data WHERE id='xe54g';
total
---------
105861
\d+ data
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
-----------+-------+-----------+----------+-----------+----------+--------------+-------------
total | real | | | 0 | plain | |
How do I get it to return the full precision? I'm using PG 11.1.