Postgres

Adding the Postgres changes, probably we need to change some small things to make it work more seamless