Python Data Type Conversion In Postgresql