Cast number to string in Postgres

fixes #9170
Merge pull request #9686 from strzalek/cast_number_to_string_in_pg

Cast number to string in Postgres