fix for postgres issue and permissions #938