6

I am getting PGError: ERROR: integer out of range message from trying to insert the following integer: 100001389928198.

According to the Postgres docs on numeric datatypes the limit is much higher (9223372036854775807). I have a feeling Heroku is treating the column as a regular integer rather than a BIGINT.

I defined the migration as a BIGINT as such:

t.column :uid, :bigint

is this not correct in terms of Heroku migrations?

Henrik Heimbuerger
  • 9,924
  • 6
  • 56
  • 69
neon
  • 2,811
  • 6
  • 30
  • 44

1 Answers1

9

I am not sure t.column is same as change_column or not, but here is how according to api

change_column :table_name, :uid, :bigint
YOU
  • 120,166
  • 34
  • 186
  • 219
  • my original migration was as stated above, but running this one did the trick. thanks! – neon Aug 26 '11 at 07:48
  • this worked for me too.. surprising given that :bigint isn't listed as one of the column types in the migrations guide and that :limit => 8 seemed to work for me on pg locally.. – Kevin Davis Mar 20 '12 at 07:05
  • Hmm...I tried this and got the error undefined method `bigint' for # Ended up doing t.integer :field, :limit => 8 instead to limit the size. – Mark Locklear Jun 10 '13 at 13:29