numeric(12,2), or an integer number of centsnumeric stores exact decimal values, so 0.10 + 0.20 is exactly 0.30. An integer number of cents is also exact.
"double precision" and "real" are floating-point types. They store binary approximations, so rounding errors build up in sums. "varchar(20)" is a string column. It can't do arithmetic, and it can't make sure the value is a number.
Read more