new version with postgresql