fixes pagination for postgres
It does this by using a offset parameter that doesn't lose precision.
This breaks compatibility with Ruby 1.8.7 by using a Rational.