mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
Some cleanups in CREATE/ALTER/DROP USER ref pages.
This commit is contained in:
@ -1,45 +1,49 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.18 2001/12/08 03:24:33 thomas Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.19 2002/02/27 21:14:53 petere Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<refentry id="SQL-ALTERUSER">
|
<refentry id="SQL-ALTERUSER">
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle id="sql-alteruser-title">
|
<refentrytitle id="sql-alteruser-title">ALTER USER</refentrytitle>
|
||||||
ALTER USER
|
|
||||||
</refentrytitle>
|
|
||||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>
|
<refname>ALTER USER</refname>
|
||||||
ALTER USER
|
<refpurpose>change a database user account</refpurpose>
|
||||||
</refname>
|
|
||||||
<refpurpose>
|
|
||||||
change a database user account
|
|
||||||
</refpurpose>
|
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<refsynopsisdivinfo>
|
<synopsis>
|
||||||
<date>2001-07-10</date>
|
|
||||||
</refsynopsisdivinfo>
|
|
||||||
<synopsis>
|
|
||||||
ALTER USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
|
ALTER USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
|
||||||
|
|
||||||
where <replaceable class="PARAMETER">option</replaceable> can be:
|
where <replaceable class="PARAMETER">option</replaceable> can be:
|
||||||
|
|
||||||
[ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
[ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
||||||
| CREATEDB | NOCREATEDB
|
| CREATEDB | NOCREATEDB
|
||||||
| CREATEUSER | NOCREATEUSER
|
| CREATEUSER | NOCREATEUSER
|
||||||
| VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>'
|
| VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>'
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-ALTERUSER-1">
|
<refsect1>
|
||||||
<refsect2info>
|
<title>Description</title>
|
||||||
<date>1998-09-08</date>
|
|
||||||
</refsect2info>
|
<para>
|
||||||
<title>
|
<command>ALTER USER</command> is used to change the attributes of a
|
||||||
Inputs
|
<productname>PostgreSQL</productname> user account. Attributes not
|
||||||
</title>
|
mentioned in the command retain their previous settings.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Only a database superuser can change privileges and password
|
||||||
|
expiration with this command. Ordinary users can only change their
|
||||||
|
own password.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2>
|
||||||
|
<title>Parameters</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
@ -47,7 +51,7 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
|
|||||||
<term><replaceable class="PARAMETER">username</replaceable></term>
|
<term><replaceable class="PARAMETER">username</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of the user whose details are to be altered.
|
The name of the user whose attributes are to be altered.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -62,12 +66,12 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>ENCRYPTED</term>
|
<term><literal>ENCRYPTED</literal></term>
|
||||||
<term>UNENCRYPTED</term>
|
<term><literal>UNENCRYPTED</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These keywords control whether the
|
These key words control whether the password is stored
|
||||||
password is stored encrypted in <literal>pg_shadow</>. (See
|
encrypted in <literal>pg_shadow</>. (See
|
||||||
<xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
|
<xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
|
||||||
for more information about this choice.)
|
for more information about this choice.)
|
||||||
</para>
|
</para>
|
||||||
@ -75,26 +79,27 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>CREATEDB</term>
|
<term><literal>CREATEDB</literal></term>
|
||||||
<term>NOCREATEDB</term>
|
<term><literal>NOCREATEDB</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These clauses define a user's ability to create databases.
|
These clauses define a user's ability to create databases. If
|
||||||
If CREATEDB is specified, the user being defined will
|
<literal>CREATEDB</literal> is specified, the user being
|
||||||
be allowed to create his own databases. Using NOCREATEDB
|
defined will be allowed to create his own databases. Using
|
||||||
will deny a user the ability to create databases.
|
<literal>NOCREATEDB</literal> will deny a user the ability to
|
||||||
|
create databases.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>CREATEUSER</term>
|
<term><literal>CREATEUSER</literal></term>
|
||||||
<term>NOCREATEUSER</term>
|
<term><literal>NOCREATEUSER</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These clauses determine whether a user will be permitted to
|
These clauses determine whether a user will be permitted to
|
||||||
create new users himself. This option will also make the user
|
create new users himself. This option will also make the user
|
||||||
a superuser who can override all access restrictions.
|
a superuser who can override all access restrictions.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -111,122 +116,105 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
|
|||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
<refsect2 id="R2-SQL-ALTERUSER-2">
|
|
||||||
<refsect2info>
|
<refsect1>
|
||||||
<date>1998-09-08</date>
|
<title>Diagnostics</title>
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Outputs
|
|
||||||
</title>
|
|
||||||
<para>
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term><computeroutput>ALTER USER</computeroutput></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Message returned if the alteration was successful.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><computeroutput>
|
|
||||||
ERROR: ALTER USER: user "username" does not exist
|
|
||||||
</computeroutput></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Error message returned if the specified user is not known to
|
|
||||||
the database.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-ALTERUSER-1">
|
|
||||||
<refsect1info>
|
|
||||||
<date>1998-09-08</date>
|
|
||||||
</refsect1info>
|
|
||||||
<title>
|
|
||||||
Description
|
|
||||||
</title>
|
|
||||||
<para>
|
<para>
|
||||||
<command>ALTER USER</command> is used to change the attributes of a user's
|
<variablelist>
|
||||||
<productname>PostgreSQL</productname> account. Attributes not mentioned
|
<varlistentry>
|
||||||
in the command retain their previous settings.
|
<term><computeroutput>ALTER USER</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the alteration was successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>ERROR: ALTER USER: user "username" does not exist</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Error message returned if the specified user is not known to
|
||||||
|
the database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Only a database superuser
|
Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
|
||||||
can change privileges and password expiration with this command. Ordinary
|
to add new users, and <xref linkend="SQL-DROPUSER"
|
||||||
users can only change their own password.
|
endterm="SQL-DROPUSER-title"> to remoe a user.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>ALTER USER</command> cannot change a user's group memberships.
|
<command>ALTER USER</command> cannot change a user's group memberships.
|
||||||
Use <xref linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title">
|
Use <xref linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title">
|
||||||
to do that.
|
to do that.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
|
||||||
Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
|
|
||||||
to create a new user and <xref linkend="SQL-DROPUSER"
|
|
||||||
endterm="SQL-DROPUSER-title"> to remove a user.
|
|
||||||
</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-ALTERUSER-2">
|
<refsect1>
|
||||||
<title>
|
<title>Examples</title>
|
||||||
Usage
|
|
||||||
</title>
|
|
||||||
<para>
|
<para>
|
||||||
Change a user password:
|
Change a user password:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER USER davide WITH PASSWORD 'hu8jmn3';
|
ALTER USER davide WITH PASSWORD 'hu8jmn3';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
Change a user's valid until date:
|
Change a user's valid until date:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
|
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
Change a user's valid until date, specifying that his
|
Change a user's valid until date, specifying that his
|
||||||
authorization should expire at midday on 4th May 1998 using
|
authorization should expire at midday on 4th May 1998 using
|
||||||
the time zone which is one hour ahead of UTC:
|
the time zone which is one hour ahead of UTC:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
|
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
Give a user the ability to create other users and new databases:
|
Give a user the ability to create other users and new databases:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER USER miriam CREATEUSER CREATEDB;
|
ALTER USER miriam CREATEUSER CREATEDB;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-ALTERUSER-3">
|
<refsect1>
|
||||||
<title>
|
<title>Compatibility</title>
|
||||||
Compatibility
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-ALTERUSER-4">
|
<para>
|
||||||
<refsect2info>
|
The <command>ALTER USER</command> statement is a
|
||||||
<date>1998-09-08</date>
|
<productname>PostgreSQL</productname> extension. The SQL standard
|
||||||
</refsect2info>
|
leaves the definition of users to the implementation.
|
||||||
<title>
|
</para>
|
||||||
SQL92
|
</refsect1>
|
||||||
</title>
|
|
||||||
<para>
|
<refsect1>
|
||||||
There is no <command>ALTER USER</command> statement in
|
<title>See Also</title>
|
||||||
<acronym>SQL92</acronym>.
|
|
||||||
The standard leaves
|
<simplelist type="inline">
|
||||||
the definition of users to the implementation.
|
<member><xref linkend="sql-createuser" endterm="sql-createuser-title"></member>
|
||||||
</para>
|
<member><xref linkend="sql-dropuser" endterm="sql-dropuser-title"></member>
|
||||||
</refsect2>
|
</simplelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
||||||
|
@ -1,47 +1,48 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.22 2001/12/08 03:24:35 thomas Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.23 2002/02/27 21:14:53 petere Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<refentry id="SQL-CREATEUSER">
|
<refentry id="SQL-CREATEUSER">
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle id="sql-createuser-title">
|
<refentrytitle id="sql-createuser-title">CREATE USER</refentrytitle>
|
||||||
CREATE USER
|
|
||||||
</refentrytitle>
|
|
||||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>
|
<refname>CREATE USER</refname>
|
||||||
CREATE USER
|
<refpurpose>define a new database user account</refpurpose>
|
||||||
</refname>
|
|
||||||
<refpurpose>
|
|
||||||
define a new database user account
|
|
||||||
</refpurpose>
|
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<refsynopsisdivinfo>
|
<synopsis>
|
||||||
<date>2001-07-10</date>
|
|
||||||
</refsynopsisdivinfo>
|
|
||||||
<synopsis>
|
|
||||||
CREATE USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
|
CREATE USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
|
||||||
|
|
||||||
where <replaceable class="PARAMETER">option</replaceable> can be:
|
where <replaceable class="PARAMETER">option</replaceable> can be:
|
||||||
|
|
||||||
SYSID <replaceable class="PARAMETER">uid</replaceable>
|
SYSID <replaceable class="PARAMETER">uid</replaceable>
|
||||||
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
||||||
| CREATEDB | NOCREATEDB
|
| CREATEDB | NOCREATEDB
|
||||||
| CREATEUSER | NOCREATEUSER
|
| CREATEUSER | NOCREATEUSER
|
||||||
| IN GROUP <replaceable class="PARAMETER">groupname</replaceable> [, ...]
|
| IN GROUP <replaceable class="PARAMETER">groupname</replaceable> [, ...]
|
||||||
| VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>'
|
| VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>'
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
<refsect2 id="R2-SQL-CREATEUSER-1">
|
|
||||||
<refsect2info>
|
<refsect1>
|
||||||
<date>1998-09-21</date>
|
<title>Description</title>
|
||||||
</refsect2info>
|
|
||||||
<title>
|
<para>
|
||||||
Inputs
|
<command>CREATE USER</command> will add a new user to an instance
|
||||||
</title>
|
of <productname>PostgreSQL</productname>. Refer to the
|
||||||
|
<citetitle>Administrator's Guide</citetitle> for information about
|
||||||
|
managing users and authentication. You must be a database
|
||||||
|
superuser to use this command.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2>
|
||||||
|
<title>Parameters</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
@ -58,14 +59,14 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
|
|||||||
<term><replaceable class="parameter">uid</replaceable></term>
|
<term><replaceable class="parameter">uid</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <literal>SYSID</literal> clause can be used to choose
|
The <literal>SYSID</literal> clause can be used to choose the
|
||||||
the <productname>PostgreSQL</productname> user id of the user
|
<productname>PostgreSQL</productname> user ID of the user that
|
||||||
that is being created. It is not at all necessary that those
|
is being created. It is not at all necessary that those match
|
||||||
match the <acronym>UNIX</acronym> user ids, but some people
|
the Unix user IDs, but some people choose to keep the numbers
|
||||||
choose to keep the numbers the same.
|
the same.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If this is not specified, the highest assigned user id plus one
|
If this is not specified, the highest assigned user ID plus one
|
||||||
(with a minimum of 100) will be used as default.
|
(with a minimum of 100) will be used as default.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -85,54 +86,57 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>ENCRYPTED</term>
|
<term><literal>ENCRYPTED</></term>
|
||||||
<term>UNENCRYPTED</term>
|
<term><literal>UNENCRYPTED</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These keywords control whether the
|
These keywords control whether the password is stored
|
||||||
password is stored encrypted in <literal>pg_shadow</>. (If neither
|
encrypted in <literal>pg_shadow</>. (If neither is specified,
|
||||||
is specified, the default behavior is determined by the
|
the default behavior is determined by the
|
||||||
<varname>PASSWORD_ENCRYPTION</varname> server parameter.)
|
<varname>PASSWORD_ENCRYPTION</varname> server parameter.) If
|
||||||
If the presented string is already in MD5-encrypted format,
|
the presented string is already in MD5-encrypted format, then
|
||||||
then it is stored as-is, regardless of whether
|
it is stored as-is, regardless of whether
|
||||||
ENCRYPTED or UNENCRYPTED
|
<literal>ENCRYPTED</> or <literal>UNENCRYPTED</> is specified.
|
||||||
is specified. This allows reloading of encrypted passwords
|
This allows reloading of encrypted passwords during
|
||||||
during dump/restore.
|
dump/restore.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
|
||||||
|
<para>
|
||||||
See the chapter on client authentication in the
|
See the chapter on client authentication in the
|
||||||
<citetitle>Administrator's Guide</citetitle> for details on
|
<citetitle>Administrator's Guide</citetitle> for details on
|
||||||
how to set up authentication mechanisms. Note that older clients
|
how to set up authentication mechanisms. Note that older
|
||||||
may lack support for the MD5 authentication mechanism that's needed
|
clients may lack support for the MD5 authentication mechanism
|
||||||
to work with passwords that are stored encrypted.
|
that is needed to work with passwords that are stored
|
||||||
|
encrypted.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>CREATEDB</term>
|
<term><literal>CREATEDB</></term>
|
||||||
<term>NOCREATEDB</term>
|
<term><literal>NOCREATEDB</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These clauses define a user's ability to create databases.
|
These clauses define a user's ability to create databases. If
|
||||||
If CREATEDB is specified, the user being defined will
|
<literal>CREATEDB</literal> is specified, the user being
|
||||||
be allowed to create his own databases. Using NOCREATEDB
|
defined will be allowed to create his own databases. Using
|
||||||
will deny a user the ability to create databases. If this
|
<literal>NOCREATEDB</literal> will deny a user the ability to
|
||||||
clause is omitted, NOCREATEDB is used by default.
|
create databases. If this clause is omitted,
|
||||||
|
<literal>NOCREATEDB</literal> is used by default.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>CREATEUSER</term>
|
<term><literal>CREATEUSER</literal></term>
|
||||||
<term>NOCREATEUSER</term>
|
<term><literal>NOCREATEUSER</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These clauses determine whether a user will be permitted to
|
These clauses determine whether a user will be permitted to
|
||||||
create new users himself. This option will also make the user
|
create new users himself. This option will also make the user
|
||||||
a superuser who can override all access restrictions.
|
a superuser who can override all access restrictions.
|
||||||
Omitting this clause will set the user's value of this
|
Omitting this clause will set the user's value of this
|
||||||
attribute to be NOCREATEUSER.
|
attribute to be <literal>NOCREATEUSER</literal>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -151,73 +155,58 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
|
|||||||
<term><replaceable class="parameter">abstime</replaceable></term>
|
<term><replaceable class="parameter">abstime</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The VALID UNTIL clause sets an absolute time after which the
|
The <literal>VALID UNTIL</literal> clause sets an absolute
|
||||||
user's password is no longer valid.
|
time after which the user's password is no longer valid. If
|
||||||
If this clause is omitted the login will be valid for all time.
|
this clause is omitted the login will be valid for all time.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-CREATEUSER-2">
|
|
||||||
<refsect2info>
|
|
||||||
<date>1998-09-21</date>
|
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Outputs
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term><computeroutput>CREATE USER</computeroutput></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Message returned if the command completes successfully.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-CREATEUSER-1">
|
|
||||||
<refsect1info>
|
|
||||||
<date>1998-09-21</date>
|
|
||||||
</refsect1info>
|
|
||||||
<title>
|
|
||||||
Description
|
|
||||||
</title>
|
|
||||||
<para>
|
|
||||||
<command>CREATE USER</command> will add a new user to an instance of
|
|
||||||
<productname>PostgreSQL</productname>. Refer to the administrator's
|
|
||||||
guide for information about managing users and authentication.
|
|
||||||
You must be a database superuser to use this command.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Use <xref linkend="SQL-ALTERUSER" endterm="SQL-ALTERUSER-title">
|
|
||||||
to change a user's password and privileges, and <xref linkend="SQL-DROPUSER"
|
|
||||||
endterm="SQL-DROPUSER-title"> to remove a user.
|
|
||||||
Use <xref linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title">
|
|
||||||
to add or remove the user from other groups.
|
|
||||||
<productname>PostgreSQL</productname>
|
|
||||||
comes with a script <xref linkend="APP-CREATEUSER"
|
|
||||||
endterm="APP-CREATEUSER-title">
|
|
||||||
which has the same functionality as this command (in fact, it calls this command)
|
|
||||||
but can be run from the command shell.
|
|
||||||
</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
<refsect1 id="R1-SQL-CREATEUSER-2">
|
|
||||||
<title>
|
<refsect1>
|
||||||
Usage
|
<title>Diagnostics</title>
|
||||||
</title>
|
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>CREATE USER</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the command completes successfully.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Notes</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Use <xref linkend="SQL-ALTERUSER" endterm="SQL-ALTERUSER-title"> to
|
||||||
|
change the attributes of a user, and <xref linkend="SQL-DROPUSER"
|
||||||
|
endterm="SQL-DROPUSER-title"> to remove a user. Use <xref
|
||||||
|
linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title"> to add the
|
||||||
|
user to groups or remove the user from groups.
|
||||||
|
<productname>PostgreSQL</productname> includes a program <xref
|
||||||
|
linkend="APP-CREATEUSER" endterm="APP-CREATEUSER-title"> that has
|
||||||
|
the same functionality as this command (in fact, it calls this
|
||||||
|
command) but can be run from the command shell.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Examples</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Create a user with no password:
|
Create a user with no password:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE USER jonathan
|
CREATE USER jonathan;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -246,23 +235,24 @@ CREATE USER manuel WITH PASSWORD 'jw8s0F4' CREATEDB;
|
|||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-CREATEUSER-3">
|
<refsect1>
|
||||||
<title>
|
<title>Compatibility</title>
|
||||||
Compatibility
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-CREATEUSER-4">
|
<para>
|
||||||
<refsect2info>
|
The <command>CREATE USER</command> statement is a
|
||||||
<date>1998-09-21</date>
|
<productname>PostgreSQL</productname> extension. The SQL standard
|
||||||
</refsect2info>
|
leaves the definition of users to the implementation.
|
||||||
<title>
|
</para>
|
||||||
SQL92
|
</refsect1>
|
||||||
</title>
|
|
||||||
|
|
||||||
<para>
|
<refsect1>
|
||||||
There is no <command>CREATE USER</command> statement in SQL92.
|
<title>See Also</title>
|
||||||
</para>
|
|
||||||
</refsect2>
|
<simplelist type="inline">
|
||||||
|
<member><xref linkend="sql-alteruser" endterm="sql-alteruser-title"></member>
|
||||||
|
<member><xref linkend="sql-dropuser" endterm="sql-dropuser-title"></member>
|
||||||
|
<member><xref linkend="app-createuser"></member>
|
||||||
|
</simplelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
||||||
|
@ -1,40 +1,37 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.14 2002/01/20 22:19:56 petere Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.15 2002/02/27 21:14:54 petere Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<refentry id="SQL-DROPUSER">
|
<refentry id="SQL-DROPUSER">
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle id="SQL-DROPUSER-TITLE">
|
<refentrytitle id="SQL-DROPUSER-TITLE">DROP USER</refentrytitle>
|
||||||
DROP USER
|
|
||||||
</refentrytitle>
|
|
||||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>
|
<refname>DROP USER</refname>
|
||||||
DROP USER
|
<refpurpose>remove a database user account</refpurpose>
|
||||||
</refname>
|
|
||||||
<refpurpose>
|
|
||||||
remove a database user account
|
|
||||||
</refpurpose>
|
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<refsynopsisdiv>
|
|
||||||
<refsynopsisdivinfo>
|
|
||||||
<date>1999-07-20</date>
|
|
||||||
</refsynopsisdivinfo>
|
|
||||||
<synopsis>
|
|
||||||
DROP USER <replaceable class="PARAMETER">name</replaceable>
|
|
||||||
</synopsis>
|
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-DROPUSER-1">
|
|
||||||
<refsect2info>
|
|
||||||
<date>1998-09-22</date>
|
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Inputs
|
|
||||||
</title>
|
|
||||||
<para>
|
|
||||||
|
|
||||||
|
<refsynopsisdiv>
|
||||||
|
<synopsis>
|
||||||
|
DROP USER <replaceable class="PARAMETER">name</replaceable>
|
||||||
|
</synopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Description</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<command>DROP USER</command> removes the specified user from the database.
|
||||||
|
It does not remove tables, views, or other objects owned by the user. If the
|
||||||
|
user owns any database, an error is raised.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2>
|
||||||
|
<title>Parameters</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
@ -47,80 +44,62 @@ DROP USER <replaceable class="PARAMETER">name</replaceable>
|
|||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-DROPUSER-2">
|
|
||||||
<refsect2info>
|
|
||||||
<date>1998-09-22</date>
|
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Outputs
|
|
||||||
</title>
|
|
||||||
<para>
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term><computeroutput>DROP USER</computeroutput></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The message returned if the user is successfully deleted.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
</refsect1>
|
||||||
<term><computeroutput>
|
|
||||||
ERROR: DROP USER: user "<replaceable class="parameter">name</replaceable>" does not exist
|
|
||||||
</computeroutput></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
This message occurs if the user name is not found.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<refsect1>
|
||||||
<term><computeroutput>
|
<title>Diagnostics</title>
|
||||||
DROP USER: user "<replaceable class="parameter">name</replaceable>" owns database "<replaceable class="parameter">name</replaceable>", cannot be removed
|
|
||||||
</computeroutput></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
You must drop the database first or change its ownership.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-DROPUSER-1">
|
|
||||||
<refsect1info>
|
|
||||||
<date>1998-09-22</date>
|
|
||||||
</refsect1info>
|
|
||||||
<title>
|
|
||||||
Description
|
|
||||||
</title>
|
|
||||||
<para>
|
<para>
|
||||||
<command>DROP USER</command> removes the specified user from the database.
|
<variablelist>
|
||||||
It does not remove tables, views, or other objects owned by the user. If the
|
<varlistentry>
|
||||||
user owns any database you get an error.
|
<term><computeroutput>DROP USER</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the user is successfully deleted.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>ERROR: DROP USER: user "<replaceable class="parameter">name</replaceable>" does not exist</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the user name is not found.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>DROP USER: user "<replaceable class="parameter">name</replaceable>" owns database "<replaceable class="parameter">name</replaceable>", cannot be removed</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You must drop the database first or change its ownership.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
|
Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
|
||||||
to add new users, and <xref linkend="SQL-ALTERUSER"
|
to add new users, and <xref linkend="SQL-ALTERUSER"
|
||||||
endterm="SQL-ALTERUSER-title"> to change a user's properties.
|
endterm="SQL-ALTERUSER-title"> to change a user's attributes.
|
||||||
<productname>PostgreSQL</productname>
|
<productname>PostgreSQL</productname> includes a program <xref
|
||||||
comes with a script <xref linkend="APP-DROPUSER"
|
linkend="APP-DROPUSER" endterm="APP-DROPUSER-title"> that has the
|
||||||
endterm="APP-DROPUSER-title">
|
same functionality as this command (in fact, it calls this command)
|
||||||
which has the same functionality as this command (in fact, it calls this command)
|
|
||||||
but can be run from the command shell.
|
but can be run from the command shell.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-DROPUSER-2">
|
<refsect1>
|
||||||
<title>
|
<title>Examples</title>
|
||||||
Usage
|
|
||||||
</title>
|
|
||||||
<para>
|
<para>
|
||||||
To drop a user account:
|
To drop a user account:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@ -129,23 +108,26 @@ DROP USER jonathan;
|
|||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-DROPUSER-3">
|
<refsect1>
|
||||||
<title>
|
<title>Compatibility</title>
|
||||||
Compatibility
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-DROPUSER-4">
|
<para>
|
||||||
<refsect2info>
|
The <command>DROP USER</command> statement is a
|
||||||
<date>1998-09-22</date>
|
<productname>PostgreSQL</productname> extension. The SQL standard
|
||||||
</refsect2info>
|
leaves the definition of users to the implementation.
|
||||||
<title>
|
</para>
|
||||||
SQL92
|
|
||||||
</title>
|
|
||||||
<para>
|
|
||||||
There is no <command>DROP USER</command> in <acronym>SQL92</acronym>.
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>See Also</title>
|
||||||
|
|
||||||
|
<simplelist type="inline">
|
||||||
|
<member><xref linkend="sql-createuser" endterm="sql-createuser-title"></member>
|
||||||
|
<member><xref linkend="sql-alteruser" endterm="sql-alteruser-title"></member>
|
||||||
|
<member><xref linkend="app-dropuser"></member>
|
||||||
|
</simplelist>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
Reference in New Issue
Block a user