Postgresql support

wrote test code for PostgreSQL