Skip to content

Conversation

@MaxGabriel
Copy link
Member

@MaxGabriel MaxGabriel commented Feb 8, 2018

…for numeric values

I ran into this error recently when not specifying precision for a numeric column, and the error message was pretty bad (it didn't tell you the table or column name that was the problem)

I also cleaned up the variable names. They were named things like x or y which made it pretty hard to tell what was what.

Before submitting your PR, check that you've:

  • Bumped the version number

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

, ". Postgres defaults to a maximum scale of 147,455 and precision of 16383,"
, " which is probably not what you intended."
, " Specify the values as numeric(total_digits, digits_after_decimal_place)."
]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative to this error message would be to try to use a numeric value with extremely high scale and precision. It isn't possible to match the Postgres maximums, because the unspecified value has a precision of 16383, while the Postgres docs say:

The maximum allowed precision when explicitly specified in the type declaration is 1000

See table 8.2 for these limits: https://www.postgresql.org/docs/10/static/datatype-numeric.html

@MaxGabriel MaxGabriel merged commit 64d6b3f into master Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants