numeric definition advice
От | Raimon Fernandez |
---|---|
Тема | numeric definition advice |
Дата | |
Msg-id | 9EF315C0-3AD5-46AE-BE36-12404ADC24BD@montx.com обсуждение исходный текст |
Ответ на | Explain explained ("Markus Stocker" <markus@wilabs.ch>) |
Ответы |
Re: numeric definition advice
|
Список | pgsql-novice |
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
В списке pgsql-novice по дате отправления: