我想整理一下我的postgreSQL数据库中的角色,当我偶然发现一个我从来没有意识到创建的角色时。我认为这与承载数据库的Linux用户有关,但奇怪的是,当我试图更改或删除该角色时,系统假装不存在该用户。
select * from pg_roles;
rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcatupdate | rolcanlogin | rolreplication | rolconnlimit | rolpassword | rolvaliduntil | rolconfig | oid
---------------+----------+------------+---------------+-------------+--------------+-------------+----------------+--------------+-------------+---------------+-----------+-------
postgreSQL | t | t | t | t | t | t | f | -1 | ******** | | | 16387
postgres | t | t | t | t | t | t | t | -1 | ******** | | | 10
standard_wimi | f | t | f | f | f | f | f | -1 | ******** | | | 17992 enter code here因此,postgres是我的超级用户,standard_wimi是我刚刚创建的角色。一开始我尝试放弃角色postgreSQL,因为我似乎不需要它,因此我认为它不应该存在(具有这种特权)。但是,任何试图删除或更改该角色的尝试都会产生以下结果:
ALTER ROLE postgreSQL NOLOGIN;
ERROR: role "postgresql" does not exist有人能给我解释一下这种行为吗?角色从何而来?为什么psql假装它不存在?
提前感谢!
发布于 2016-02-09 17:08:12
角色区分大小写,没有分隔的每个区分大小写的标识符都转换为小写。
ALTER ROLE "postgreSQL" NOLOGIN;https://stackoverflow.com/questions/35297860
复制相似问题