Cast number to string in Postgres

This pull request fixes issue #9170

It's connected with Arel issue: https://github.com/rails/arel/pull/172