Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > numeric definit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 12 Topic 3026 of 3322
Post > Topic >>

numeric definition advice

by coder@[EMAIL PROTECTED] (Raimon Fernandez) Mar 7, 2008 at 11:40 AM

Hello,


I'm converting a database from SQLite to PostgreSQL, and I would like  
to have some punctuatioons about the numeric type.

I want to store monetary values, they need to have decimals, of  
course, and most of times a precission of 2.

I see that Postgre has a Monetary type, but in some places I read it's  
better to stay with numeric type.

So, in Numeric, we can specify how many decimals (scale) and the  
precision.

What happens if I only know how many decimals I want to store, and  
have no limit on the precision ?

Is valid to have a numeric with no precision and a scale of 2 ?

I'm plyaing a little and sometimes postgreSQL doesn't allow to change  
the precission of the defined fields.

And I can do this and latter change it ?

CREATE DOMAIN currency
   AS numeric(10,2);


So, maybe sometimes I 'll need to have numbers greater than 8 digits  
(10-2=8) ?

Also I read that the memory requeriments increase as more digits I  
declare ...

I'm worrying for nothing ?


thanks,


raimon


-- 
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
 




 12 Posts in Topic:
Explain explained
markus@[EMAIL PROTECTED]   2008-03-04 09:53:32 
Re: Explain explained
rdeleonp@[EMAIL PROTECTED  2008-03-04 10:21:07 
Re: Explain explained
tgl@[EMAIL PROTECTED] (T  2008-03-04 13:26:17 
Re: Explain explained
markus@[EMAIL PROTECTED]   2008-03-04 15:52:30 
Re: Explain explained
tgl@[EMAIL PROTECTED] (T  2008-03-04 17:30:31 
Re: Explain explained
markus@[EMAIL PROTECTED]   2008-03-04 17:59:45 
numeric definition advice
coder@[EMAIL PROTECTED]   2008-03-07 11:40:55 
Re: numeric definition advice
tgl@[EMAIL PROTECTED] (T  2008-03-07 08:37:30 
Re: numeric definition advice
coder@[EMAIL PROTECTED]   2008-03-07 19:49:04 
warnings restoring a db
coder@[EMAIL PROTECTED]   2008-04-09 08:59:48 
Re: warnings restoring a db
tgl@[EMAIL PROTECTED] (T  2008-04-09 10:43:53 
Re: warnings restoring a db
coder@[EMAIL PROTECTED]   2008-04-09 16:52:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 3:37:13 CST 2008.