createuser
&コマンドがありますdropuser
:
createuser - define a new PostgreSQL user account
dropuser - remove a PostgreSQL user account
ユーザーアカウントを一覧表示する適切な方法はありますか?
これら2つのコマンドを使用するには、ユーザーが呼び出す必要があるかどうか、psql
使用状況を知る必要はありません。
ベストアンサー1
シェルを使用psql
し、次の操作を行います。
\deu[+] [PATTERN]
たとえば、
postgres=# \deu+
List of user mappings
Server | User name | FDW Options
--------+-----------+-------------
(0 rows)
すべてのユーザーの場合:
postgres=# \du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------+-----------
chpert.net | | {}
postgres | Superuser, Create role, Create DB, Replication | {}
別の例はMySQLです。次のようにできます。
$ psql -c "\du"
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
chpert | | {}
postgres | Superuser, Create role, Create DB, Replication | {}
test | | {}