创建postgres 用户 fastapi
CREATE USER fastapi WITH PASSWORD 'fastapi';
修改fastapi的密码
ALTER USER fastapi WITH PASSWORD 'NEWPASSWORD';
创建对应的数据库
CREATE DATABASE fastapi;
GRANT ALL PRIVILEGES ON DATABASE fastapi TO fastapi;
## 移除其他库的权限,但是可以看到库和库的表,但是不能看到内容
REVOKE ALL PRIVILEGES ON ALL postgres FROM fastapi;
REVOKE CONNECT ON DATABASE postgres FROM fastapi;