Postgresql Data Types Conversion