Fix for postgres db