| --- |
| title: dropuser |
| --- |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| Removes a database role. |
| |
| ## <a id="topic1__section2"></a>Synopsis |
| |
| ``` pre |
| dropuser [<connection_options>] [-e | --echo] [-i | --interactive] <role_name> |
| |
| dropuser --help |
| |
| dropuser --version |
| ``` |
| |
| ## <a id="topic1__section3"></a>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`. |
| |
| ## <a id="args"></a>Arguments |
| |
| <dt>**\<role\_name\>** </dt> |
| <dd>The name of the role to be removed. You will be prompted for a name if not specified on the command line.</dd> |
| |
| |
| ## <a id="topic1__section4"></a>Options |
| |
| <dt>-i, -\\\-interactive </dt> |
| <dd>Prompt for confirmation before actually removing the role.</dd> |
| |
| <dt>-e, -\\\-echo </dt> |
| <dd>Echo the commands that `dropuser` generates and sends to the server.</dd> |
| |
| **\<connection_options\>** |
| |
| <dt>-h, -\\\-host \<host\> </dt> |
| <dd>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.</dd> |
| |
| <dt>-p, -\\\-port \<port\> </dt> |
| <dd>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.</dd> |
| |
| <dt>-U, -\\\-username \<username\> </dt> |
| <dd>The database role name to connect as. If not specified, reads from the environment variable `PGUSER` or defaults to the current system role name.</dd> |
| |
| <dt>-w, -\\\-no-password </dt> |
| <dd>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.</dd> |
| |
| <dt>-W, -\\\-password </dt> |
| <dd>Force a password prompt.</dd> |
| |
| |
| **Other Options** |
| |
| <dt>-\\\-help </dt> |
| <dd>Displays the online help.</dd> |
| |
| <dt>-\\\-version </dt> |
| <dd>Displays the version of this utility.</dd> |
| |
| ## <a id="topic1__section6"></a>Examples |
| |
| To remove the role `joe` using default connection options: |
| |
| ``` shell |
| $ dropuser joe |
| ``` |
| |
| To remove the role `joe` using connection options, with verification, and a peek at the underlying command: |
| |
| ``` shell |
| $ dropuser -p 54321 -h masterhost -i -e joe |
| Role "joe" will be permanently removed. |
| Are you sure? (y/n) y |
| DROP ROLE "joe" |
| ``` |