diff options
author | Tom Lane | 2012-10-04 17:41:16 +0000 |
---|---|---|
committer | Tom Lane | 2012-10-04 17:41:16 +0000 |
commit | ef23ad39be1fded9e12609c3472e328e2575647e (patch) | |
tree | 3e62fcf2fca7da2dc0f6b8b9b534c637d03cd276 | |
parent | 3a937bf72f25c5c5f1ed6588a2ccf4be250306dc (diff) |
Fix permissions explanations in CREATE DATABASE and CREATE SCHEMA docs.
These reference pages still claimed that you have to be superuser to create
a database or schema owned by a different role. That was true before 8.1,
but it was changed in commits aa1110624c08298393dfce996f7b21809d98d3fd and
f91370cd2faf1fd35a1ac74d84652a85ed841919 to allow assignment of ownership
to any role you are a member of. However, at the time we were thinking of
that primarily as a change to the ALTER OWNER rules, so the need to touch
these two CREATE ref pages got missed.
-rw-r--r-- | doc/src/sgml/ref/create_database.sgml | 14 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_schema.sgml | 13 |
2 files changed, 12 insertions, 15 deletions
diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml index 786a63b7020..d770eb17798 100644 --- a/doc/src/sgml/ref/create_database.sgml +++ b/doc/src/sgml/ref/create_database.sgml @@ -47,14 +47,6 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> </para> <para> - Normally, the creator becomes the owner of the new database. - Superusers can create databases owned by other users, by using the - <literal>OWNER</> clause. They can even create databases owned by - users with no special privileges. Non-superusers with <literal>CREATEDB</> - privilege can only create databases owned by themselves. - </para> - - <para> By default, the new database will be created by cloning the standard system database <literal>template1</>. A different template can be specified by writing <literal>TEMPLATE @@ -84,9 +76,11 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> <term><replaceable class="parameter">dbowner</replaceable></term> <listitem> <para> - The name of the database user who will own the new database, + The role name of the user who will own the new database, or <literal>DEFAULT</literal> to use the default (namely, the - user executing the command). + user executing the command). To create a database owned by another + role, you must be a direct or indirect member of that role, + or be a superuser. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/create_schema.sgml b/doc/src/sgml/ref/create_schema.sgml index 14cfa8a8f0c..4039c2fc137 100644 --- a/doc/src/sgml/ref/create_schema.sgml +++ b/doc/src/sgml/ref/create_schema.sgml @@ -65,7 +65,8 @@ CREATE SCHEMA AUTHORIZATION <replaceable class="parameter">username</replaceable <term><replaceable class="parameter">schemaname</replaceable></term> <listitem> <para> - The name of a schema to be created. If this is omitted, the user name + The name of a schema to be created. If this is omitted, the + <replaceable class="parameter">username</replaceable> is used as the schema name. The name cannot begin with <literal>pg_</literal>, as such names are reserved for system schemas. @@ -77,9 +78,10 @@ CREATE SCHEMA AUTHORIZATION <replaceable class="parameter">username</replaceable <term><replaceable class="parameter">username</replaceable></term> <listitem> <para> - The name of the user who will own the schema. If omitted, - defaults to the user executing the command. Only superusers - can create schemas owned by users other than themselves. + The role name of the user who will own the new schema. If omitted, + defaults to the user executing the command. To create a schema + owned by another role, you must be a direct or indirect member of + that role, or be a superuser. </para> </listitem> </varlistentry> @@ -176,7 +178,8 @@ CREATE VIEW hollywood.winners AS all objects within it. <productname>PostgreSQL</productname> allows schemas to contain objects owned by users other than the schema owner. This can happen only if the schema owner grants the - <literal>CREATE</> privilege on his schema to someone else. + <literal>CREATE</> privilege on his schema to someone else, or a + superuser chooses to create objects in it. </para> </refsect1> |