Amended file to use Postgres