Quote:
Originally Posted by CarlosinFL
OK there's a value for 'numeric' which from what I can see is identical / same thing as 'decimal'. Why is there two different data types which have the same value? I can't find a single slight difference between 'decimal' & 'numeric' except that 'numeric' is a data type option available in pgAdmin3.
|
As I said they are equivalent. Why that is so I don't know. You would need to ask that on the pg mailing list.
Quote:
|
I don't know what SQL scripts you're referring to
|
Any DBMS schema should be created by using a SQL script with the approriate CREATE TABLE statements. Nothing should be done "ad-hoc" in psql or any other SQL client.
Quote:
|
I only refer to pdAdmin3 when I can't remember something or need help
|
You should rather consult the manual. Everything (including numeric and decimal) is documented there:
PostgreSQL: Documentation: Manuals: Data Types
Quote:
|
I know there's a 'precision' & 'scale' but I can't find any examples of how to create one. Lets say I have a field / column for salary and I want to input a users anual salary of $32,412, would that be a scale 2 and precision 3?
|
Again, this is documented in the manual:
PostgreSQL: Documentation: Manuals: Numeric Types
Quote:
|
Originally Posted by The Fine Manual
The scale of a numeric is the count of decimal digits in the fractional part, to the right of the decimal point. The precision of a numeric is the total count of significant digits in the whole number, that is, the number of digits to both sides of the decimal point. So the number 23.5141 has a precision of 6 and a scale of 4. Integers can be considered to have a scale of zero
|