2000-01-14 23:11:38 +01:00
|
|
|
<!--
|
2006-09-16 02:30:20 +02:00
|
|
|
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_group.sgml,v 1.17 2006/09/16 00:30:16 momjian Exp $
|
2001-12-08 04:24:40 +01:00
|
|
|
PostgreSQL documentation
|
2000-01-14 23:11:38 +01:00
|
|
|
-->
|
|
|
|
|
|
|
|
<refentry id="SQL-ALTERGROUP">
|
|
|
|
<refmeta>
|
2002-04-21 21:02:39 +02:00
|
|
|
<refentrytitle id="SQL-ALTERGROUP-title">ALTER GROUP</refentrytitle>
|
2000-01-14 23:11:38 +01:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
2003-04-15 15:25:08 +02:00
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
<refnamediv>
|
2003-04-15 15:25:08 +02:00
|
|
|
<refname>ALTER GROUP</refname>
|
2005-07-27 01:24:02 +02:00
|
|
|
<refpurpose>change role name or membership</refpurpose>
|
2000-01-14 23:11:38 +01:00
|
|
|
</refnamediv>
|
2003-04-15 15:25:08 +02:00
|
|
|
|
2003-08-31 19:32:24 +02:00
|
|
|
<indexterm zone="sql-altergroup">
|
|
|
|
<primary>ALTER GROUP</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
<refsynopsisdiv>
|
2003-04-15 15:25:08 +02:00
|
|
|
<synopsis>
|
|
|
|
ALTER GROUP <replaceable class="PARAMETER">groupname</replaceable> ADD USER <replaceable class="PARAMETER">username</replaceable> [, ... ]
|
|
|
|
ALTER GROUP <replaceable class="PARAMETER">groupname</replaceable> DROP USER <replaceable class="PARAMETER">username</replaceable> [, ... ]
|
2003-06-27 16:45:32 +02:00
|
|
|
|
|
|
|
ALTER GROUP <replaceable class="PARAMETER">groupname</replaceable> RENAME TO <replaceable>newname</replaceable>
|
2003-04-15 15:25:08 +02:00
|
|
|
</synopsis>
|
2000-01-14 23:11:38 +01:00
|
|
|
</refsynopsisdiv>
|
|
|
|
|
2003-04-15 15:25:08 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
<para>
|
2005-01-04 01:39:53 +01:00
|
|
|
<command>ALTER GROUP</command> changes the attributes of a user group.
|
2005-07-27 01:24:02 +02:00
|
|
|
This is an obsolete command, though still accepted for backwards
|
|
|
|
compatibility, because groups (and users too) have been superseded by the
|
|
|
|
more general concept of roles.
|
2005-01-04 01:39:53 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The first two variants add users to a group or remove them from a group.
|
2005-07-27 01:24:02 +02:00
|
|
|
(Any role can play the part of either a <quote>user</> or a
|
|
|
|
<quote>group</> for this purpose.) These variants are effectively
|
|
|
|
equivalent to granting or revoking membership in the role named as the
|
|
|
|
<quote>group</>; so the preferred way to do this is to use
|
|
|
|
<xref linkend="SQL-GRANT" endterm="SQL-GRANT-title"> or
|
|
|
|
<xref linkend="SQL-REVOKE" endterm="SQL-REVOKE-title">.
|
2000-01-14 23:11:38 +01:00
|
|
|
</para>
|
2003-04-15 15:25:08 +02:00
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
<para>
|
2005-07-27 01:24:02 +02:00
|
|
|
The third variant changes the name of the group. This is exactly
|
|
|
|
equivalent to renaming the role with
|
|
|
|
<xref linkend="sql-alterrole" endterm="sql-alterrole-title">.
|
2000-01-14 23:11:38 +01:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2003-04-15 15:25:08 +02:00
|
|
|
<refsect1>
|
2003-09-12 02:12:47 +02:00
|
|
|
<title>Parameters</title>
|
2003-04-15 15:25:08 +02:00
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="PARAMETER">groupname</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2005-07-27 01:24:02 +02:00
|
|
|
The name of the group (role) to modify.
|
2003-04-15 15:25:08 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="PARAMETER">username</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2005-07-27 01:24:02 +02:00
|
|
|
Users (roles) that are to be added to or removed from the group.
|
|
|
|
The users must already exist; <command>ALTER GROUP</> does not
|
|
|
|
create or drop users.
|
2003-04-15 15:25:08 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2003-06-27 16:45:32 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable>newname</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The new name of the group.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2003-04-15 15:25:08 +02:00
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
2000-01-14 23:11:38 +01:00
|
|
|
<para>
|
|
|
|
Add users to a group:
|
|
|
|
|
|
|
|
<programlisting>
|
2001-09-12 03:55:25 +02:00
|
|
|
ALTER GROUP staff ADD USER karl, john;
|
2000-01-14 23:11:38 +01:00
|
|
|
</programlisting>
|
|
|
|
|
2000-07-22 04:39:10 +02:00
|
|
|
Remove a user from a group:
|
2000-01-14 23:11:38 +01:00
|
|
|
|
|
|
|
<programlisting>
|
2001-09-12 03:55:25 +02:00
|
|
|
ALTER GROUP workers DROP USER beth;
|
2000-01-14 23:11:38 +01:00
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2003-04-15 15:25:08 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Compatibility</title>
|
2000-01-14 23:11:38 +01:00
|
|
|
|
2003-04-15 15:25:08 +02:00
|
|
|
<para>
|
|
|
|
There is no <command>ALTER GROUP</command> statement in the SQL
|
2005-07-27 01:24:02 +02:00
|
|
|
standard.
|
2003-04-15 15:25:08 +02:00
|
|
|
</para>
|
2000-01-14 23:11:38 +01:00
|
|
|
</refsect1>
|
2003-06-27 16:45:32 +02:00
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
2005-07-27 01:24:02 +02:00
|
|
|
<member><xref linkend="sql-grant" endterm="sql-grant-title"></member>
|
|
|
|
<member><xref linkend="sql-revoke" endterm="sql-revoke-title"></member>
|
|
|
|
<member><xref linkend="sql-alterrole" endterm="sql-alterrole-title"></member>
|
2003-06-27 16:45:32 +02:00
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
|
2000-01-14 23:11:38 +01:00
|
|
|
</refentry>
|