Integer out of range in PostgreSQL database

后端 未结 3 1892
终归单人心
终归单人心 2020-12-17 10:41

I\'m trying to save a number representing the length of a file (4825733517). The column is set to type integer. I don\'t have any validations or restrictions set.

3条回答
  •  天涯浪人
    2020-12-17 11:01

    You should change the length of the column in your database with a migration :

    update_column :my_table, :my_column, :integer, limit: 12
    

    It will allow you to store bigger integers.

提交回复
热议问题