Re: Precision of data types and functions

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: "Brandon Aiken" <BAiken(at)winemantech(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Precision of data types and functions
Date: 2006-08-28 18:12:46
Message-ID: 87k64s91b5.fsf@suzuka.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Brandon Aiken" <BAiken(at)winemantech(dot)com> writes:

> I'm considering migrating our MySQL 4.1 database (barf!) to PostgreSQL 8
> or MySQL 5.
>
> The guy who originally designed the system made all the number data
> FLOATs, even for currency items. Unsurprisingly, we've noticed math
> errors resulting from some of the aggregate functions. I've learned
> MySQL 5 stores numbers with the DECIMAL data type as text strings, and
> does math at 64-bit precision. Where can I find information about how
> precise PostgreSQL 8 math is?

You probably want to use NUMERIC for currency values. See:

http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-NUMERIC-DECIMAL

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2006-08-28 18:21:06 Re: Precision of data types and functions
Previous Message Tom Lane 2006-08-28 18:10:13 Re: Can't see what's wrong with this function?