replaced couchdb with postgresql