1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ALTER GROUP</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="sql-commands.html" title="SQL Commands">
<link rel="prev" href="sql-alterfunction.html" title="ALTER FUNCTION">
<link rel="next" href="sql-alterindex.html" title="ALTER INDEX">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="sql-altergroup"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>ALTER GROUP — change role name or membership</p>
</div>
<a name="id742661"></a><div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">ALTER GROUP <em class="replaceable"><code>groupname</code></em> ADD USER <em class="replaceable"><code>username</code></em> [, ... ]
ALTER GROUP <em class="replaceable"><code>groupname</code></em> DROP USER <em class="replaceable"><code>username</code></em> [, ... ]
ALTER GROUP <em class="replaceable"><code>groupname</code></em> RENAME TO <em class="replaceable"><code>newname</code></em></pre>
</div>
<div class="refsect1" lang="en">
<a name="id742716"></a><h2>Description</h2>
<p> <code class="command">ALTER GROUP</code> changes the attributes of a user group.
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.
</p>
<p> The first two variants add users to a group or remove them from a group.
(Any role can play the part of either a “<span class="quote">user</span>” or a
“<span class="quote">group</span>” for this purpose.) These variants are effectively
equivalent to granting or revoking membership in the role named as the
“<span class="quote">group</span>”; so the preferred way to do this is to use
<a href="sql-grant.html">GRANT</a> or
<a href="sql-revoke.html">REVOKE</a>.
</p>
<p> The third variant changes the name of the group. This is exactly
equivalent to renaming the role with
<a href="sql-alterrole.html">ALTER ROLE</a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id742789"></a><h2>Parameters</h2>
<div class="variablelist"><dl>
<dt><span class="term"><em class="replaceable"><code>groupname</code></em></span></dt>
<dd><p> The name of the group (role) to modify.
</p></dd>
<dt><span class="term"><em class="replaceable"><code>username</code></em></span></dt>
<dd><p> Users (roles) that are to be added to or removed from the group.
The users must already exist; <code class="command">ALTER GROUP</code> does not
create or drop users.
</p></dd>
<dt><span class="term"><em class="replaceable"><code>newname</code></em></span></dt>
<dd><p> The new name of the group.
</p></dd>
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id742837"></a><h2>Examples</h2>
<p> Add users to a group:
</p>
<pre class="programlisting">ALTER GROUP staff ADD USER karl, john;</pre>
<p>
Remove a user from a group:
</p>
<pre class="programlisting">ALTER GROUP workers DROP USER beth;</pre>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id742858"></a><h2>Compatibility</h2>
<p> There is no <code class="command">ALTER GROUP</code> statement in the SQL
standard.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id742872"></a><h2>See Also</h2>
<span class="simplelist"><a href="sql-grant.html">GRANT</a>, <a href="sql-revoke.html">REVOKE</a>, <a href="sql-alterrole.html">ALTER ROLE</a></span>
</div>
</div></body>
</html>
|