dropuser - remove a PostgreSQL user account

SYNOPSIS

dropuser [ option...] [ username]

DESCRIPTION Description

dropuser delete an existing PostgreSQL user and the user all databases. Only the super user (set user usesuper in pg_shadow table) can create new PostgreSQL users.

dropuser is the USER SQL command the DROP [ drop_user package (7)] of. Therefore, deleting a user makes no difference which method.

OPTIONS Options

dropuser accepts the following command line arguments:

username

 To delete a statement PostgreSQL user name. If you do not specify on the command line, you will be prompted to enter a.
-e
--echo

 Echo dropuser generated commands sent to the server.
-i
--interactive

 Before actually deleted before the user prompts.
-q
--quiet

 Not display a response.

 

createuser also accepts the following command line arguments for connection parameters:

-h host
--host host

 Host name of the machine running the server. If the value begins with a slash, it is used for the Unix domain socket.
-p port
--port Port

 Internet server is listening TCP port or local Unix domain socket file extension (descriptor).
-U username
--username username

 Username (username is not to be created) connection.
-W
--password

 Force a password prompt (the password server connections, not the new user's password.)

 

ENVIRONMENT Environment

PGHOST
PGPORT
PGUSER

 The default connection parameters.

DIAGNOSTICS diagnosis


 If an error occurs, the backend error message will be displayed. See the USER the DROP [ drop_user (. 7)] and  the psql (. 1) for possibilities. The database server must be running on the target host. Also, any libpq front-end library available to the default settings and environment variables to take effect.

EXAMPLES Examples


 To delete a user joe on the default database server:

 

$ dropuser joe
DROP USER


 With the server on host eden delete user joe, port 5000, before executing the command prompt and the underlying command:

 

$ 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

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11081429.html