From 57309068a0c279f06fe85532e45e2a6813f72d32 Mon Sep 17 00:00:00 2001
From: Erik Wienhold <ewie@ewie.name>
Date: Mon, 4 Sep 2023 02:54:40 +0200
Subject: [PATCH] Document privileges createuser grants to superusers

Commit 8ae0d476a9 added option --superuser to createuser.  In contrast
to CREATE ROLE, createuser also grants CREATEDB and CREATEROLE to new
superusers.  This commit documents this feature.
---
 doc/src/sgml/ref/createuser.sgml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/ref/createuser.sgml b/doc/src/sgml/ref/createuser.sgml
index 5c34c62342..73c5ae9d77 100644
--- a/doc/src/sgml/ref/createuser.sgml
+++ b/doc/src/sgml/ref/createuser.sgml
@@ -56,6 +56,9 @@ PostgreSQL documentation
    <acronym>SQL</acronym> command <link linkend="sql-createrole"><command>CREATE ROLE</command></link>.
    There is no effective difference between creating users via
    this utility and via other methods for accessing the server.
+   But note that <application>createuser</application> also grants
+   <literal>CREATEDB</literal> and <literal>CREATEROLE</literal>
+   to superusers.
   </para>
 
  </refsect1>
@@ -120,7 +123,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         The new user will not be allowed to create databases.  This is the
-        default.
+        default, except when <option>--superuser</option> is also specified.
        </para>
       </listitem>
      </varlistentry>
@@ -265,7 +268,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         The new user will not be allowed to create new roles.  This is the
-        default.
+        default, except when <option>--superuser</option> is also specified.
        </para>
       </listitem>
      </varlistentry>
@@ -275,7 +278,8 @@ PostgreSQL documentation
       <term><option>--superuser</option></term>
       <listitem>
        <para>
-        The new user will be a superuser.
+        The new user will be a superuser.  Also implies <option>--createdb</option>
+        and <option>--createrole</option>.
        </para>
       </listitem>
      </varlistentry>
-- 
2.42.0

