--切换到管理员账号(postgres),新建普通账号 CREATE USER test_phq WITH PASSWORD 'pcms'; --切换到指定数据库public下(yuding)、赋予数据库级别的权限 GRANT ALL PRIVILEGES ON DATABASE yuding TO test_phq; --切换到指定数据库public下(yuding)、赋予全部表的全部权限 GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO test_phq; --切换到指定数据库public下(yuding)、赋予全部序列的全部权限 GRANT ALL PRIVILEGES ON ALL sequences IN SCHEMA public TO test_phq; --切换到指定数据库public下(yuding)、删除普通账号 REASSIGN OWNED BY test_phq TO postgres; DROP OWNED BY test_phq; DROP USER test_phq;