在Postgres中,我如何将现有用户更改为超级用户?出于各种原因,我不想删除现有用户。
# alter user myuser ...?
# alter user myuser ...?
ALTER USER myuser WITH SUPERUSER PASSWORD 'pgpassword' VALID UNTIL '2034-12-2';
john
设为超级用户(由超级用户操作)。*您必须使用任何超级用户(例如postgres
)登录,并且可以省略可选的WITH
参数:ALTER ROLE john WITH SUPERUSER;
或者:
ALTER USER john WITH SUPERUSER;
john
设置为非超级用户:ALTER ROLE john WITH NOSUPERUSER;
或者:
ALTER USER john WITH NOSUPERUSER;