Home Explore Blog CI



postgresql

doc/src/sgml/ref/drop_user.sgml
085d6ae6db024bb8051f20153a496757c93ee673ded3038200000003000004b5
<!--
doc/src/sgml/ref/drop_user.sgml
PostgreSQL documentation
-->

<refentry id="sql-dropuser">
 <indexterm zone="sql-dropuser">
  <primary>DROP USER</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>DROP USER</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>DROP USER</refname>
  <refpurpose>remove a database role</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
DROP USER [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ...]
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP USER</command> is simply an alternate spelling of
   <link linkend="sql-droprole"><command>DROP ROLE</command></link>.
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   The <command>DROP USER</command> statement is a
   <productname>PostgreSQL</productname> extension.  The SQL standard
   leaves the definition of users to the implementation.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-droprole"/></member>
  </simplelist>
 </refsect1>

</refentry>

Chunks
a5e5e13a (1st chunk of `doc/src/sgml/ref/drop_user.sgml`)
Title: DROP USER
Summary
The DROP USER command in PostgreSQL is used to remove a database role. It functions identically to the DROP ROLE command, providing an alternative way to achieve the same outcome. The syntax is straightforward: DROP USER followed by the name of the user to be removed. The optional IF EXISTS clause prevents an error from being raised if the specified user does not exist. This command is a PostgreSQL extension to the SQL standard, which typically leaves the management of users to the specific database implementation. Therefore, while DROP USER is a convenient and readily available command in PostgreSQL, its behavior and availability might not be consistent across different database systems. For more details, refer to the DROP ROLE documentation, as both commands are functionally equivalent. Use DROP USER with caution, as removing a user can impact database access and permissions.