Re: psql: Add role's membership options to the \du+ command

Поиск
Список
Период
Сортировка
От David Zhang
Тема Re: psql: Add role's membership options to the \du+ command
Дата
Msg-id ee39eff0-3c0d-4367-4595-619fd1763a5d@highgo.ca
обсуждение исходный текст
Ответ на Re: psql: Add role's membership options to the \du+ command  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: psql: Add role's membership options to the \du+ command  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On 2023-02-10 2:27 p.m., David G. Johnston wrote:
On Fri, Feb 10, 2023 at 2:08 PM David Zhang <david.zhang@highgo.ca> wrote:

I noticed the document psql-ref.sgml has been updated for both `du+` and
`dg+`, but only `du` and `\du+` are covered in regression test. Is that
because `dg+` is treated exactly the same as `du+` from testing point of
view?

Yes.

The reason I am asking this question is that I notice that `pg_monitor`
also has the detailed information, so not sure if more test cases required.

Of course it does.  Why does that bother you?  And what does that have to do with the previous paragraph?

There is a default built-in role `pg_monitor` and the behavior changed after the patch. If `\dg+` and `\du+` is treated as the same, and `make check` all pass, then I assume there is no test case to verify the output of `duS+`. My point is should we consider add a test case?

Before patch the output for `pg_monitor`,

postgres=# \duS+
                                                                             List of roles
          Role name          |                         Attributes                         |                          Member of                           | Description
-----------------------------+------------------------------------------------------------+--------------------------------------------------------------+-------------
 alice                       |                                                            | {pg_read_all_settings,pg_read_all_stats,pg_stat_scan_tables} |
 pg_checkpoint               | Cannot login                                               | {}                                                           |
 pg_database_owner           | Cannot login                                               | {}                                                           |
 pg_execute_server_program   | Cannot login                                               | {}                                                           |
 pg_maintain                 | Cannot login                                               | {}                                                           |
 pg_monitor                  | Cannot login                                               | {pg_read_all_settings,pg_read_all_stats,pg_stat_scan_tables} |
 pg_read_all_data            | Cannot login                                               | {}                                                           |
 pg_read_all_settings        | Cannot login                                               | {}                                                           |
 pg_read_all_stats           | Cannot login                                               | {}                                                           |
 pg_read_server_files        | Cannot login                                               | {}                                                           |
 pg_signal_backend           | Cannot login                                               | {}                                                           |
 pg_stat_scan_tables         | Cannot login                                               | {}                                                           |
 pg_use_reserved_connections | Cannot login                                               | {}                                                           |
 pg_write_all_data           | Cannot login                                               | {}                                                           |
 pg_write_server_files       | Cannot login                                               | {}                                                           |
 ubuntu                      | Superuser, Create role, Create DB, Replication, Bypass RLS | {}                                                           |


After patch the output for `pg_monitor`,

postgres=# \duS+
                                                                     List of roles
          Role name          |                         Attributes                         |                   Member of                   | Description
-----------------------------+------------------------------------------------------------+-----------------------------------------------+-------------
 alice                       |                                                            | pg_read_all_settings WITH ADMIN, INHERIT, SET+|
                             |                                                            | pg_read_all_stats WITH INHERIT               +|
                             |                                                            | pg_stat_scan_tables                           |
 pg_checkpoint               | Cannot login                                               |                                               |
 pg_database_owner           | Cannot login                                               |                                               |
 pg_execute_server_program   | Cannot login                                               |                                               |
 pg_maintain                 | Cannot login                                               |                                               |
 pg_monitor                  | Cannot login                                               | pg_read_all_settings WITH INHERIT, SET       +|
                             |                                                            | pg_read_all_stats WITH INHERIT, SET          +|
                             |                                                            | pg_stat_scan_tables WITH INHERIT, SET         |
 pg_read_all_data            | Cannot login                                               |                                               |
 pg_read_all_settings        | Cannot login                                               |                                               |
 pg_read_all_stats           | Cannot login                                               |                                               |
 pg_read_server_files        | Cannot login                                               |                                               |
 pg_signal_backend           | Cannot login                                               |                                               |
 pg_stat_scan_tables         | Cannot login                                               |                                               |
 pg_use_reserved_connections | Cannot login                                               |                                               |
 pg_write_all_data           | Cannot login                                               |                                               |
 pg_write_server_files       | Cannot login                                               |                                               |
 ubuntu                      | Superuser, Create role, Create DB, Replication, Bypass RLS |                                               |


Best regards,

David


David J.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Joel Jacobson"
Дата:
Сообщение: [PATCH] FIx alloc_var() ndigits thinko
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: psql: Add role's membership options to the \du+ command