dropuser

Removes a database role.

Synopsis

  1. dropuser [<connection_options>] [-e | --echo] [-i | --interactive] <role_name>
  2. dropuser --help
  3. dropuser --version

Description

dropuser removes an existing role from HAWQ. Only superusers and users with the CREATEROLE privilege can remove roles. To remove a superuser role, you must yourself be a superuser.

dropuser is a wrapper around the SQL command DROP ROLE.

Arguments

<role_name>

The name of the role to be removed. You will be prompted for a name if not specified on the command line.

Options

-i, —interactive

Prompt for confirmation before actually removing the role.

-e, —echo

Echo the commands that dropuser generates and sends to the server.

<connection_options>

-h, —host <host>

The host name of the machine on which the HAWQ master database server is running. If not specified, reads from the environment variable PGHOST or defaults to localhost.

-p, —port <port>

The TCP port on which the HAWQ master database server is listening for connections. If not specified, reads from the environment variable PGPORT or defaults to 5432.

-U, —username <username>

The database role name to connect as. If not specified, reads from the environment variable PGUSER or defaults to the current system role name.

-w, —no-password

Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.

-W, —password

Force a password prompt.

Other Options

--help

Displays the online help.

--version

Displays the version of this utility.

Examples

To remove the role joe using default connection options:

  1. $ dropuser joe

To remove the role joe using connection options, with verification, and a peek at the underlying command:

  1. $ dropuser -p 54321 -h masterhost -i -e joe
  2. Role "joe" will be permanently removed.
  3. Are you sure? (y/n) y
  4. DROP ROLE "joe"