Commit 840b7f52 authored by Tom Lane's avatar Tom Lane

Update administrator's guide chapters for ROLEs patch.

parent bf86bacb
This diff is collapsed.
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.42 2005/06/21 04:02:30 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.43 2005/08/14 23:35:37 tgl Exp $
--> -->
<chapter id="managing-databases"> <chapter id="managing-databases">
...@@ -94,7 +94,7 @@ SELECT datname FROM pg_database; ...@@ -94,7 +94,7 @@ SELECT datname FROM pg_database;
CREATE DATABASE <replaceable>name</>; CREATE DATABASE <replaceable>name</>;
</synopsis> </synopsis>
where <replaceable>name</> follows the usual rules for where <replaceable>name</> follows the usual rules for
<acronym>SQL</acronym> identifiers. The current user automatically <acronym>SQL</acronym> identifiers. The current role automatically
becomes the owner of the new database. It is the privilege of the becomes the owner of the new database. It is the privilege of the
owner of a database to remove it later on (which also removes all owner of a database to remove it later on (which also removes all
the objects in it, even if they have a different owner). the objects in it, even if they have a different owner).
...@@ -102,7 +102,7 @@ CREATE DATABASE <replaceable>name</>; ...@@ -102,7 +102,7 @@ CREATE DATABASE <replaceable>name</>;
<para> <para>
The creation of databases is a restricted operation. See <xref The creation of databases is a restricted operation. See <xref
linkend="user-attributes"> for how to grant permission. linkend="role-attributes"> for how to grant permission.
</para> </para>
<para> <para>
...@@ -158,18 +158,18 @@ createdb <replaceable class="parameter">dbname</replaceable> ...@@ -158,18 +158,18 @@ createdb <replaceable class="parameter">dbname</replaceable>
<para> <para>
Sometimes you want to create a database for someone else. That Sometimes you want to create a database for someone else. That
user should become the owner of the new database, so he can role should become the owner of the new database, so he can
configure and manage it himself. To achieve that, use one of the configure and manage it himself. To achieve that, use one of the
following commands: following commands:
<programlisting> <programlisting>
CREATE DATABASE <replaceable>dbname</> OWNER <replaceable>username</>; CREATE DATABASE <replaceable>dbname</> OWNER <replaceable>rolename</>;
</programlisting> </programlisting>
from the SQL environment, or from the SQL environment, or
<programlisting> <programlisting>
createdb -O <replaceable>username</> <replaceable>dbname</> createdb -O <replaceable>rolename</> <replaceable>dbname</>
</programlisting> </programlisting>
You must be a superuser to be allowed to create a database for You must be a superuser to be allowed to create a database for
someone else. someone else (that is, for a role you are not a member of).
</para> </para>
</sect1> </sect1>
...@@ -327,7 +327,7 @@ ALTER DATABASE mydb SET geqo TO off; ...@@ -327,7 +327,7 @@ ALTER DATABASE mydb SET geqo TO off;
<synopsis> <synopsis>
DROP DATABASE <replaceable>name</>; DROP DATABASE <replaceable>name</>;
</synopsis> </synopsis>
Only the owner of the database (i.e., the user that created it), or Only the owner of the database, or
a superuser, can drop a database. Dropping a database removes all objects a superuser, can drop a database. Dropping a database removes all objects
that were that were
contained within the database. The destruction of a database cannot contained within the database. The destruction of a database cannot
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_role.sgml,v 1.2 2005/07/31 17:19:17 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/create_role.sgml,v 1.3 2005/08/14 23:35:38 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -141,7 +141,7 @@ where <replaceable class="PARAMETER">option</replaceable> can be: ...@@ -141,7 +141,7 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
<para> <para>
These clauses determine whether a role <quote>inherits</> the These clauses determine whether a role <quote>inherits</> the
privileges of roles it is a member of. privileges of roles it is a member of.
A role with <literal>INHERIT</literal> privilege can automatically A role with the <literal>INHERIT</literal> attribute can automatically
use whatever database privileges have been granted to all roles use whatever database privileges have been granted to all roles
it is directly or indirectly a member of. it is directly or indirectly a member of.
Without <literal>INHERIT</literal>, membership in another role Without <literal>INHERIT</literal>, membership in another role
...@@ -162,7 +162,7 @@ where <replaceable class="PARAMETER">option</replaceable> can be: ...@@ -162,7 +162,7 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
These clauses determine whether a role is allowed to log in; These clauses determine whether a role is allowed to log in;
that is, whether the role can be given as the initial session that is, whether the role can be given as the initial session
authorization name during client connection. A role having authorization name during client connection. A role having
<literal>LOGIN</literal> privilege can be thought of as a user. the <literal>LOGIN</literal> attribute can be thought of as a user.
Roles without this attribute are useful for managing database Roles without this attribute are useful for managing database
privileges, but are not users in the usual sense of the word. privileges, but are not users in the usual sense of the word.
If not specified, If not specified,
...@@ -188,7 +188,7 @@ where <replaceable class="PARAMETER">option</replaceable> can be: ...@@ -188,7 +188,7 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
<listitem> <listitem>
<para> <para>
Sets the role's password. (A password is only of use for Sets the role's password. (A password is only of use for
roles having <literal>LOGIN</literal> privilege, but you can roles having the <literal>LOGIN</literal> attribute, but you can
nonetheless define one for roles without it.) nonetheless define one for roles without it.)
If you do not plan to use password If you do not plan to use password
authentication you can omit this option. authentication you can omit this option.
...@@ -325,7 +325,19 @@ where <replaceable class="PARAMETER">option</replaceable> can be: ...@@ -325,7 +325,19 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
</para> </para>
<para> <para>
<literal>INHERIT</> privilege is the default for reasons of backwards The <literal>INHERIT</> attribute governs inheritance of grantable
privileges (that is, access privileges for database objects and role
memberships). It does not apply to the special role attributes set by
<command>CREATE ROLE</> and <command>ALTER ROLE</>. For example, being
a member of a role with <literal>CREATEDB</> privilege does not immediately
grant the ability to create databases, even if <literal>INHERIT</> is set;
it would be necessary to become that role via
<xref linkend="SQL-SET-ROLE" endterm="SQL-SET-ROLE-title"> before
creating a database.
</para>
<para>
The <literal>INHERIT</> attribute is the default for reasons of backwards
compatibility: in prior releases of <productname>PostgreSQL</productname>, compatibility: in prior releases of <productname>PostgreSQL</productname>,
users always had access to all privileges of groups they were members of. users always had access to all privileges of groups they were members of.
However, <literal>NOINHERIT</> provides a closer match to the semantics However, <literal>NOINHERIT</> provides a closer match to the semantics
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment