Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Milen A. Radev
Radhika Sambamurti написа: >> I believe the manual is quite clear on that one ( >> http://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-FLOAT) >> : >> >> " - If you require exact storage and calculations (such as for monetary >> amounts), use the numeric type instead." >> >>

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Andrew Sullivan
On Tue, Apr 17, 2007 at 04:33:33PM -0400, Radhika Sambamurti wrote: > Andrew, > This has been quite helpful. My main concern is CPU cost. Thanks for the > input. You're welcome. Are you sure your main concern should be CPU cost? It's true that numeric is more costly that float in a lot of cases,

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
> I believe the manual is quite clear on that one ( > http://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-FLOAT) > : > > " - If you require exact storage and calculations (such as for monetary > amounts), use the numeric type instead." > > > So if you decide to use floats a

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
Andrew, This has been quite helpful. My main concern is CPU cost. Thanks for the input. --Radhika > On Tue, Apr 17, 2007 at 02:53:54PM -0400, Radhika Sambamurti wrote: >> that hold money fields and rates from varchar to float. I do not want to >> convert to numeric because numeric is a special s

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
> > --- >> The question is: how accurate is floating point numbers in Postgres. We >> are using 7.4 soon to be moving to 8.2. >> I need the accuracy to about 6 decimal points. I have read that floating >> points can convert to numbers in accurately. > > http://www.postgresql.org/docs/8.2/interactiv

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Richard Broersma Jr
--- > The question is: how accurate is floating point numbers in Postgres. We > are using 7.4 soon to be moving to 8.2. > I need the accuracy to about 6 decimal points. I have read that floating > points can convert to numbers in accurately. http://www.postgresql.org/docs/8.2/interactive/datatype

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Milen A. Radev
Radhika Sambamurti написа: > Hi, > I am currently using Postgresql to maintain an application which is used > for trading and back office operations. Currently our monetary fields are > stored in Varchar. I am finding a huge CPU utilization while converting > from varchar to float. I think for reas

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Andrew Sullivan
On Tue, Apr 17, 2007 at 02:53:54PM -0400, Radhika Sambamurti wrote: > that hold money fields and rates from varchar to float. I do not want to > convert to numeric because numeric is a special string type. I think you should reconsider. The _only_ correct storage for your money data (i.e. if you

[SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
Hi, I am currently using Postgresql to maintain an application which is used for trading and back office operations. Currently our monetary fields are stored in Varchar. I am finding a huge CPU utilization while converting from varchar to float. I think for reasons unknown to me, we originally stor