我想创建一个只能访问指定数据库的用户。但是,它应该拥有所有许可。我在Ubuntu 14.04上使用Postgresql 9.5。因此,首先,我创建一个新用户: $createuser --interactive joe Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n 接下来,我用所有者joe创建一个新数据库: $sudo -u postgres psql $CREATE DATABASE myDB OWNER joe; $GRANT …