Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

In PostgreSQL,I would like to store signed value -999.9~9999.9. For this, can I use numeric(5.1)? Or, what type should I use? Please give your any advice. Thank in advance.

share|improve this question
    
The precision of a postgresql numeric is the total number of significant digits, and the scale is the number of decimal places required. 9999.9 has 5 digits and 1 decimal place, so yes, numeric(5.1) will be OK. See the documentation for details. –  Simon MᶜKenzie 2 hours ago
    
is numeric(5.1) OK for -999.9? –  Nyi Ma Lay Win Lae Aye 2 hours ago
    
Why don't you try and insert a negative value and see what happens? Anyway, numeric is part of the sql standard, and yes, it's signed. –  Simon MᶜKenzie 2 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.