首页 > 解决方案 > 默认角色无法登录 Postgres 10

问题描述

我正在配置一个 postgres 数据库,我看到默认角色 pg_monitor、pg_read_all_settings、pg_read_all_stats、pg_signal_backend 和 pg_stat_scan_tables 都无法登录。我不确定第一步会是什么。这是 \l 和 \du 的输出:

postgres=# \l
                                   List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |    Access privileges
-----------+----------+----------+-------------+-------------+-------------------------
 confdb02  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres           +
           |          |          |             |             | postgres=CTc/postgres  +
           |          |          |             |             | confluence=CTc/postgres
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres            +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres            +
           |          |          |             |             | postgres=CTc/postgres
(4 rows)

postgres=# \du
                                                            List of roles
      Role name       |                   Attributes                   |                          Member of
----------------------+------------------------------------------------+--------------------------------------------------------------
 confluence           | Superuser, Create role, Create DB              | {}
 pg_monitor           | Cannot login                                   | {pg_read_all_settings,pg_read_all_stats,pg_stat_scan_tables}
 pg_read_all_settings | Cannot login                                   | {}
 pg_read_all_stats    | Cannot login                                   | {}
 pg_signal_backend    | Cannot login                                   | {}
 pg_stat_scan_tables  | Cannot login                                   | {}
 postgres             | Superuser, Create role, Create DB, Replication | {}

Thanks!

标签: postgresqlpostgresql-10

解决方案


推荐阅读