select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Unsupported versions: 7.0 / 6.5 / 6.4
Historical version. PostgreSQL 6.5 reached end of support in June 2004. See the current manual for supported releases.

DROP USER

Name

DROP USER — Removes an user account information
DROP USER name
  

Inputs

name

The name of an existing user.

Outputs

DROP

The message returned if the user is successfully deleted.

ERROR: removeUser: user "name" does not exist.

This message occurs if the username is not found.

Description

DROP USER removes the specified user from the database, along with any databases owned by the user. It does not remove tables, views, or triggers owned by the named user in databases not owned by the user. This statement can be used in place of the destroyuser script, regardless of how the user was created.

Notes

DROP USER is a Postgres language extension.

Refer to CREATE USER and ALTER USER for information on how to create or modify user accounts.

Usage

To drop a user account:

DROP USER Jonathan;
   

Compatibility

SQL92

There is no DROP USER in SQL92.

Report a documentation issue

Read the upstream documentation. For corrections, first check the current manual.