.\\" auto-generated by docbook2man-spec $Revision: 1.25 $ .TH "DROPUSER" "1" "2002-11-22" "Application" "PostgreSQL Client Applications" .SH NAME dropuser \- remove a PostgreSQL user account .SH SYNOPSIS .sp \fBdropuser\fR\fR [ \fR\fB\fIoptions\fB\fR...\fB \fR\fR]\fR\fR [ \fR\fB\fIusername\fB \fR\fR]\fR .SH "DESCRIPTION" .PP \fBdropuser\fR removes an existing PostgreSQL user \fBand\fR the databases which that user owned. Only users with usesuper set in the pg_shadow table can destroy PostgreSQL users. .PP \fBdropuser\fR is a shell script wrapper around the SQL command DROP USER [\fBdrop_user\fR(7)] via the PostgreSQL interactive terminal \fBpsql\fR(1). Thus, there is nothing special about removing users via this or other methods. This means that the \fBpsql\fR must be found by the script and that a database server is running at the targeted host. Also, any default settings and environment variables available to \fBpsql\fR and the \fBlibpq\fR front-end library do apply. .SH "OPTIONS" .PP \fBdropuser\fR accepts the following command-line arguments: .TP \fB\fIusername\fB\fR Specifies the name of the PostgreSQL user to be removed. This name must exist in the PostgreSQL installation. You will be prompted for a name if none is specified on the command line. .TP \fB-e\fR .TP \fB--echo\fR Echo the queries that \fBdropuser\fR generates and sends to the server. .TP \fB-i\fR .TP \fB--interactive\fR Prompt for confirmation before actually removing the user. .TP \fB-q\fR .TP \fB--quiet\fR Do not display a response. .PP .PP \fBcreateuser\fR also accepts the following command-line arguments for connection parameters: .TP \fB-h \fIhost\fB\fR .TP \fB--host \fIhost\fB\fR Specifies the host name of the machine on which the server is running. If host begins with a slash, it is used as the directory for the Unix domain socket. .TP \fB-p \fIport\fB\fR .TP \fB--port \fIport\fB\fR Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the server is listening for connections. .TP \fB-U \fIusername\fB\fR .TP \fB--username \fIusername\fB\fR User name to connect as (not the user name to drop) .TP \fB-W\fR .TP \fB--password\fR Force password prompt (to connect to the server, not for the password of the user to be dropped). .PP .SH "ENVIRONMENT" .TP \fBPGHOST\fR .TP \fBPGPORT\fR .TP \fBPGUSER\fR Default connection parameters .SH "DIAGNOSTICS" .TP \fBDROP USER\fR All is well. .TP \fBdropuser: deletion of user "\fIusername\fB" failed\fR Something went wrong. The user was not removed. .PP If there is an error condition, the backend error message will be displayed. See DROP USER [\fBdrop_user\fR(7)] and \fBpsql\fR(1) for possibilities. .PP .SH "EXAMPLES" .PP To remove user joe from the default database server: .sp .nf $ \fBdropuser joe\fR DROP USER .sp .fi .PP To remove user joe using the postmaster on host eden, port 5000, with verification and a peek at the underlying query: .sp .nf $ \fBdropuser -p 5000 -h eden -i -e joe\fR User "joe" and any owned databases will be permanently deleted. Are you sure? (y/n) \fBy\fR DROP USER "joe" DROP USER .sp .fi .SH "SEE ALSO" \fBcreateuser\fR(1), DROP USER [\fBdrop_user\fR(7)]