Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e389f7

Browse files
committed
Fix permissions explanations in CREATE DATABASE and CREATE SCHEMA docs.
These reference pages still claimed that you have to be superuser to createa database or schema owned by a different role. That was true before 8.1,but it was changed in commitsaa11106 andf91370c to allow assignment of ownershipto any role you are a member of. However, at the time we were thinking ofthat primarily as a change to the ALTER OWNER rules, so the need to touchthese two CREATE ref pages got missed.
1 parent1a95648 commit7e389f7

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

‎doc/src/sgml/ref/create_database.sgml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
4646
See <xref linkend="SQL-CREATEUSER">.
4747
</para>
4848

49-
<para>
50-
Normally, the creator becomes the owner of the new database.
51-
Superusers can create databases owned by other users, by using the
52-
<literal>OWNER</> clause. They can even create databases owned by
53-
users with no special privileges. Non-superusers with <literal>CREATEDB</>
54-
privilege can only create databases owned by themselves.
55-
</para>
56-
5749
<para>
5850
By default, the new database will be created by cloning the standard
5951
system database <literal>template1</>. A different template can be
@@ -84,9 +76,11 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
8476
<term><replaceable class="parameter">user_name</replaceable></term>
8577
<listitem>
8678
<para>
87-
The name of the database user who will own the new database,
79+
Therolename of the user who will own the new database,
8880
or <literal>DEFAULT</literal> to use the default (namely, the
89-
user executing the command).
81+
user executing the command). To create a database owned by another
82+
role, you must be a direct or indirect member of that role,
83+
or be a superuser.
9084
</para>
9185
</listitem>
9286
</varlistentry>

‎doc/src/sgml/ref/create_schema.sgml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ CREATE SCHEMA IF NOT EXISTS AUTHORIZATION <replaceable class="parameter">user_na
6767
<term><replaceable class="parameter">schema_name</replaceable></term>
6868
<listitem>
6969
<para>
70-
The name of a schema to be created. If this is omitted, the user name
70+
The name of a schema to be created. If this is omitted, the
71+
<replaceable class="parameter">user_name</replaceable>
7172
is used as the schema name. The name cannot
7273
begin with <literal>pg_</literal>, as such names
7374
are reserved for system schemas.
@@ -79,9 +80,10 @@ CREATE SCHEMA IF NOT EXISTS AUTHORIZATION <replaceable class="parameter">user_na
7980
<term><replaceable class="parameter">user_name</replaceable></term>
8081
<listitem>
8182
<para>
82-
The name of the user who will own the schema. If omitted,
83-
defaults to the user executing the command. Only superusers
84-
can create schemas owned by users other than themselves.
83+
The role name of the user who will own the new schema. If omitted,
84+
defaults to the user executing the command. To create a schema
85+
owned by another role, you must be a direct or indirect member of
86+
that role, or be a superuser.
8587
</para>
8688
</listitem>
8789
</varlistentry>
@@ -197,7 +199,8 @@ CREATE VIEW hollywood.winners AS
197199
all objects within it. <productname>PostgreSQL</productname>
198200
allows schemas to contain objects owned by users other than the
199201
schema owner. This can happen only if the schema owner grants the
200-
<literal>CREATE</> privilege on his schema to someone else.
202+
<literal>CREATE</> privilege on his schema to someone else, or a
203+
superuser chooses to create objects in it.
201204
</para>
202205

203206
<para>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp