1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2000-07-22 06:30:27 +02:00
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.13 2000/07/22 04:30:26 momjian Exp $
|
1999-07-22 17:09:15 +02:00
|
|
|
Postgres documentation
|
|
|
|
-->
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refentry id="SQL-ALTERUSER">
|
|
|
|
<refmeta>
|
1999-07-22 17:09:15 +02:00
|
|
|
<refentrytitle id="sql-alteruser-title">
|
1999-07-06 19:16:42 +02:00
|
|
|
ALTER USER
|
|
|
|
</refentrytitle>
|
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
|
|
<refname>
|
|
|
|
ALTER USER
|
|
|
|
</refname>
|
|
|
|
<refpurpose>
|
|
|
|
Modifies user account information
|
|
|
|
</refpurpose>
|
1998-12-29 03:24:47 +01:00
|
|
|
</refnamediv>
|
1999-07-06 19:16:42 +02:00
|
|
|
<refsynopsisdiv>
|
|
|
|
<refsynopsisdivinfo>
|
1999-07-22 17:09:15 +02:00
|
|
|
<date>1999-07-20</date>
|
1999-07-06 19:16:42 +02:00
|
|
|
</refsynopsisdivinfo>
|
|
|
|
<synopsis>
|
1999-11-30 04:57:29 +01:00
|
|
|
ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
2000-01-14 23:11:38 +01:00
|
|
|
[ WITH PASSWORD '<replaceable class="PARAMETER">password</replaceable>' ]
|
1999-07-06 19:16:42 +02:00
|
|
|
[ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]
|
1998-09-16 16:43:12 +02:00
|
|
|
[ VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>' ]
|
1999-07-06 19:16:42 +02:00
|
|
|
</synopsis>
|
|
|
|
|
|
|
|
<refsect2 id="R2-SQL-ALTERUSER-1">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-09-08</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
|
|
|
Inputs
|
|
|
|
</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2000-01-14 23:11:38 +01:00
|
|
|
<term><replaceable class="PARAMETER">username</replaceable></term>
|
1999-07-06 19:16:42 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-01-14 23:11:38 +01:00
|
|
|
The name of the user whose details are to be altered.
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-01-14 23:11:38 +01:00
|
|
|
<term><replaceable class="PARAMETER">password</replaceable></term>
|
1999-07-06 19:16:42 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The new password to be used for this account.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-11-30 04:57:29 +01:00
|
|
|
<varlistentry>
|
2000-01-14 23:11:38 +01:00
|
|
|
<term>CREATEDB</term>
|
|
|
|
<term>NOCREATEDB</term>
|
1999-11-30 04:57:29 +01:00
|
|
|
<listitem>
|
2000-01-14 23:11:38 +01:00
|
|
|
<para>
|
|
|
|
These clauses define a user's ability to create databases.
|
|
|
|
If CREATEDB is specified, the user being defined will
|
|
|
|
be allowed to create his own databases. Using NOCREATEDB
|
|
|
|
will deny a user the ability to create databases.
|
1999-11-30 04:57:29 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<varlistentry>
|
2000-01-14 23:11:38 +01:00
|
|
|
<term>CREATEUSER</term>
|
|
|
|
<term>NOCREATEUSER</term>
|
1999-07-06 19:16:42 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-01-14 23:11:38 +01:00
|
|
|
These clauses determine whether a user will be permitted to
|
|
|
|
create new users himself. This option will also make the user
|
|
|
|
a superuser who can override all access restrictions.
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-01-14 23:11:38 +01:00
|
|
|
<term><replaceable class="PARAMETER">abstime</replaceable></term>
|
1999-07-06 19:16:42 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The date (and, optionally, the time)
|
2000-01-14 23:11:38 +01:00
|
|
|
at which this user's password is to expire.
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
1998-05-13 07:34:00 +02:00
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refsect2 id="R2-SQL-ALTERUSER-2">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-09-08</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
|
|
|
Outputs
|
|
|
|
</title>
|
1999-06-14 09:37:05 +02:00
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2000-01-14 23:11:38 +01:00
|
|
|
<term><computeroutput>ALTER USER</computeroutput></term>
|
1999-06-14 09:37:05 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1998-12-29 03:24:47 +01:00
|
|
|
Message returned if the alteration was successful.
|
1999-06-14 09:37:05 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1998-12-29 03:24:47 +01:00
|
|
|
|
1999-06-14 09:37:05 +02:00
|
|
|
<varlistentry>
|
1999-07-06 19:16:42 +02:00
|
|
|
<term><computeroutput>
|
2000-01-14 23:11:38 +01:00
|
|
|
ERROR: ALTER USER: user "username" does not exist
|
1999-07-06 19:16:42 +02:00
|
|
|
</computeroutput></term>
|
1999-06-14 09:37:05 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-07-06 19:16:42 +02:00
|
|
|
Error message returned if the specified user is not known to
|
|
|
|
the database.
|
1998-12-29 03:24:47 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
1999-06-14 09:37:05 +02:00
|
|
|
</refsect2>
|
|
|
|
</refsynopsisdiv>
|
1999-07-06 19:16:42 +02:00
|
|
|
|
|
|
|
<refsect1 id="R1-SQL-ALTERUSER-1">
|
|
|
|
<refsect1info>
|
|
|
|
<date>1998-09-08</date>
|
|
|
|
</refsect1info>
|
|
|
|
<title>
|
|
|
|
Description
|
|
|
|
</title>
|
|
|
|
<para>
|
|
|
|
<command>ALTER USER</command> is used to change the attributes of a user's
|
2000-03-27 19:14:43 +02:00
|
|
|
<productname>Postgres</productname> account. Only a database superuser
|
2000-01-14 23:11:38 +01:00
|
|
|
can change privileges and password expiration with this command. Ordinary
|
|
|
|
users can only change their own password.
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
|
|
|
<para>
|
2000-01-14 23:11:38 +01:00
|
|
|
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.
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 id="R1-SQL-ALTERUSER-2">
|
|
|
|
<title>
|
|
|
|
Usage
|
|
|
|
</title>
|
|
|
|
<para>
|
|
|
|
Change a user password:
|
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
<programlisting>
|
|
|
|
ALTER USER davide WITH PASSWORD 'hu8jmn3';
|
|
|
|
</programlisting>
|
1999-07-06 19:16:42 +02:00
|
|
|
|
2000-07-22 04:39:10 +02:00
|
|
|
Change a user's valid until date:
|
1999-07-06 19:16:42 +02:00
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
<programlisting>
|
1998-09-16 16:43:12 +02:00
|
|
|
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
|
2000-01-14 23:11:38 +01:00
|
|
|
</programlisting>
|
1999-07-06 19:16:42 +02:00
|
|
|
|
|
|
|
Change a user's valid until date, specifying that his
|
2000-07-22 06:30:27 +02:00
|
|
|
authorization should expire at midday on 4th May 1998 using
|
2000-07-22 04:39:10 +02:00
|
|
|
the time zone which is one hour ahead of UTC:
|
2000-01-14 23:11:38 +01:00
|
|
|
<programlisting>
|
1998-09-16 16:43:12 +02:00
|
|
|
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
|
2000-01-14 23:11:38 +01:00
|
|
|
</programlisting>
|
1999-07-06 19:16:42 +02:00
|
|
|
|
2000-07-22 04:39:10 +02:00
|
|
|
Give a user the ability to create other users and new databases:
|
1999-07-06 19:16:42 +02:00
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
<programlisting>
|
1998-09-16 16:43:12 +02:00
|
|
|
ALTER USER miriam CREATEUSER CREATEDB;
|
2000-01-14 23:11:38 +01:00
|
|
|
</programlisting>
|
1999-07-06 19:16:42 +02:00
|
|
|
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 id="R1-SQL-ALTERUSER-3">
|
|
|
|
<title>
|
|
|
|
Compatibility
|
|
|
|
</title>
|
1998-05-13 07:34:00 +02:00
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refsect2 id="R2-SQL-ALTERUSER-4">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-09-08</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
|
|
|
SQL92
|
|
|
|
</title>
|
|
|
|
<para>
|
|
|
|
There is no <command>ALTER USER</command> statement in
|
|
|
|
<acronym>SQL92</acronym>.
|
|
|
|
The standard leaves
|
|
|
|
the definition of users to the implementation.
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
1998-05-13 07:34:00 +02:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
1999-06-14 09:37:05 +02:00
|
|
|
sgml-omittag:nil
|
1998-05-13 07:34:00 +02:00
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../reference.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
-->
|