Postgresql Text To Integer Format In Python