]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_user.sgml
More minor updates and copy-editing.
[postgresql] / doc / src / sgml / ref / drop_user.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.20 2005/01/04 00:39:53 tgl Exp $
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-DROPUSER">
7  <refmeta>
8   <refentrytitle id="SQL-DROPUSER-TITLE">DROP USER</refentrytitle>
9   <refmiscinfo>SQL - Language Statements</refmiscinfo>
10  </refmeta>
11
12  <refnamediv>
13   <refname>DROP USER</refname>
14   <refpurpose>remove a database user account</refpurpose>
15  </refnamediv>
16
17  <indexterm zone="sql-dropuser">
18   <primary>DROP USER</primary>
19  </indexterm>
20
21  <refsynopsisdiv>
22 <synopsis>
23 DROP USER <replaceable class="PARAMETER">name</replaceable>
24 </synopsis>
25  </refsynopsisdiv>
26
27  <refsect1>
28   <title>Description</title>
29
30   <para>
31    <command>DROP USER</command> removes the specified user.
32    It does not remove tables, views, or other objects owned by the user. If the
33    user owns any database, an error is raised.
34   </para>
35  </refsect1>
36
37  <refsect1>
38   <title>Parameters</title>
39
40   <variablelist>
41    <varlistentry>
42     <term><replaceable class="PARAMETER">name</replaceable></term>
43     <listitem>
44      <para>
45       The name of the user to remove.
46      </para>
47     </listitem>
48    </varlistentry>
49   </variablelist>
50  </refsect1>
51
52  <refsect1>
53   <title>Notes</title>
54
55   <para>
56    <productname>PostgreSQL</productname> includes a program <xref
57    linkend="APP-DROPUSER" endterm="APP-DROPUSER-title"> that has the
58    same functionality as this command (in fact, it calls this command)
59    but can be run from the command shell.
60   </para>
61
62   <para>
63    To drop a user who owns a database, first drop the database or change
64    its ownership.
65   </para>
66
67   <para>
68    It is unwise to drop a user who either owns any database objects or has any
69    granted permissions on objects.  Currently, this is only enforced for
70    the case of owners of databases, but it is likely that future versions of
71    <productname>PostgreSQL</productname> will check other cases.
72   </para>
73  </refsect1>
74
75  <refsect1>
76   <title>Examples</title>
77
78   <para>
79    To drop a user account:
80 <programlisting>
81 DROP USER jonathan;
82 </programlisting>
83   </para>
84  </refsect1>
85  
86  <refsect1>
87   <title>Compatibility</title>
88   
89   <para>
90    The <command>DROP USER</command> statement is a
91    <productname>PostgreSQL</productname> extension.  The SQL standard
92    leaves the definition of users to the implementation.
93   </para>
94  </refsect1>
95
96  <refsect1>
97   <title>See Also</title>
98
99   <simplelist type="inline">
100    <member><xref linkend="sql-alteruser" endterm="sql-alteruser-title"></member>
101    <member><xref linkend="sql-createuser" endterm="sql-createuser-title"></member>
102   </simplelist>
103  </refsect1>
104
105 </refentry>
106
107 <!-- Keep this comment at the end of the file
108 Local variables:
109 mode: sgml
110 sgml-omittag:nil
111 sgml-shorttag:t
112 sgml-minimize-attributes:nil
113 sgml-always-quote-attributes:t
114 sgml-indent-step:1
115 sgml-indent-data:t
116 sgml-parent-document:nil
117 sgml-default-dtd-file:"../reference.ced"
118 sgml-exposed-tags:nil
119 sgml-local-catalogs:"/usr/lib/sgml/catalog"
120 sgml-local-ecat-files:nil
121 End:
122 -->