Precision of calculated numeric fields - Mailing list pgsql-general

From Travis Bauer
Subject Precision of calculated numeric fields
Date
Msg-id Pine.GSO.4.21.0006060830240.1598-100000@piccolo.cs.indiana.edu
Whole thread Raw
Responses Re: Precision of calculated numeric fields  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Consider the following:

trbauer=# create table t1 (x numberic(3,2));
trbauer=# \d t1
Attribute |   Type       | Modifier
------------------------------------
X         | numeric(3,2) |

trbauer=# create view v1 as select x*2 from t1;
trbauer=# \d v1
Attribute |     Type             | Modifier
-------------------------------------------
?column?  | numeric(65535,65531) |

How do I get the precision on the calculated numeric field to be something
sane, like 3,2?

This is important for three reasons: 1.MSAccess chokes on views
containing these fields (citing the precision size).  2. The jdbc driver
takes _forever_ to retrieve these fields into big decimal. 3. I really
don't want to reconfigure my database to use floating points :)

Thanks,
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------


pgsql-general by date:

Previous
From: "Ignas Saltis"
Date:
Subject: How to backup db with large objects?
Next
From: Ed Loehr
Date:
Subject: Re: Vacuum Question