Q:

How do we define large integers?

Possible Duplicate:
Integer out of range on Postgres DB 

When my code tries to insert big numbers such as 100001857905525 into a database on heroku, I get the error:
ActiveRecord::StatementInvalid (PGError: ERROR:  integer out of range ) 

The column has been defined as an integer. I use a sqlite3 database. My code is deployed to heroku.
It works fine when I run on localhost. But I get the above error only when I run the code on heroku.
Perhaps I can solve the issue by defining the column as a long integer or a double. How do I do this in Ruby/Rails ?

A:

in your migration, you could try this:
t.integer :uid, :limit => 8

which will produce a 64-bit integer column.
(Just integer with no limit specified will allow, according to the PostgreSQL docs, up to 10 digits.)

