dropuser - 刪除一個 PostgreSQL 使用者帳戶
dropuser [ option... ] [ username ]
dropuser 刪除一個現有 PostgreSQL 使用者 和 該使用者所有的資料庫。 只有超級使用者(在 pg_shadow 表中設定了 usesuper 的使用者)可以建立新的 PostgreSQL 使用者。
dropuser 是 SQL 命令 DROP USER [drop_user(7)] 的封裝。 因此,用哪種方法刪除使用者沒什麼區別。
如果出現錯誤,將會顯示後端錯誤資訊。參閱 DROP USER [drop_user(7)] 和 psql(1) 獲取可能資訊描述。 資料庫伺服器必須在目標主機上執行。同樣,任何 libpq 前端庫可獲得的預設設定和環境變數都將生效。
刪除預設資料庫伺服器上的使用者 joe:
$ dropuser joe
DROP USER
用在主機eden上的伺服器刪除使用者joe, 埠是 5000,執行命令前提示並且顯示執行的命令:
$ dropuser -p 5000 -h eden -i -e joe
User "joe" and any owned databases will be permanently deleted.
Are you sure? (y/n) y
DROP USER "joe"
DROP USER
Postgresql 中文網站 何偉平 <laser@pgsqldb.org>
本頁面中文版由中文 man 手冊頁計劃提供。
中文 man 手冊頁計劃:https://github.com/man-pages-zh/manpages-zh