Precision is the number of total digits in the number. Scale is the number of fractional digits.
For instance, a column defined as NUMERIC(10,3) should return precision=10, scale=3.
Yes, I understand that.
The error only occurs for a column defined as NUMERIC (without precision or scale specified). Presumably, there is a default precision and scale assigned to the column by postgreSQL, which is not -1.
There appears to be no default, which is why we currently return -1.
Scale should default to 0 per the standard, but defaults to whatever the precision is in PostgreSQL (see the docs for details).
The docs claim an implementation precision limit of 1000, but that doesn't seem to correspond to the actual implementation -- I can insert and retrieve 2000 digits NUMERICs (for example) just fine. I can't see an obvious limit on precision in the backend code. There may be a theoretical limit somewhere around 2^30 digits, I think (limited by the backend's memory allocation sanity checks), but I have not tested that.
Given that there is effectively no default, do you have suggestions for a better value to return?
-O
---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])