Numeric Data Type Rounding Up - Mailing list pgsql-novice

From Carlos Mennens
Subject Numeric Data Type Rounding Up
Date
Msg-id CAAQLLO77urJNRwbP6hyMgyYiFazRqjuoXT6wSUjA3+wTvQ__rQ@mail.gmail.com
Whole thread Raw
Responses Re: Numeric Data Type Rounding Up  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Numeric Data Type Rounding Up  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-novice
I have a table called weight and this table is tracking weight for a
few people in a fitness program that just started. I created the table
as described below:

fitness=# \d weight
                                Table "public.weight"
 Column |         Type          |                      Modifiers
--------+-----------------------+-----------------------------------------------------
 id     | integer               | not null default
nextval('weight_id_seq'::regclass)
 lbs    | numeric(5,0)          | not null
 date   | date                  | not null
 dow    | character varying(9)  | not null
 name   | character varying(50) | not null
Indexes:
    "weight_pkey" PRIMARY KEY, btree (id)

Now when I enter a value in the 'lbs' field / column of '172.80', it
rounds the value up to '173.00'. I looked on the documentation and
found a numeric data type called 'real'. I tried changing the data
type from 'NUMERIC' to 'REAL' but it didn't work. I honestly don't
know if that is even the correct numeric data type I want / need to
show exact values on something like tracking weight figures. Can
someone tell me if I'm way off here?

pgsql-novice by date:

Previous
From: DrYSG
Date:
Subject: Re: Slow duplicate deletes
Next
From: Tom Lane
Date:
Subject: Re: Numeric Data Type Rounding Up