Precision of calculated numeric fields

From: Travis Bauer <trbauer(at)indiana(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Precision of calculated numeric fields
Date: 2000-06-06 13:37:52
Message-ID: Pine.GSO.4.21.0006060830240.1598-100000@piccolo.cs.indiana.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
----------------------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ed Loehr 2000-06-06 14:17:40 Re: Vacuum Question
Previous Message Ignas Saltis 2000-06-06 12:41:17 How to backup db with large objects?