Doc: clarify introduction to database roles.

Word-smith section 22.1 ("Database Roles") a little bit in hopes
of removing confusion about how the bootstrap superuser's name
is chosen.

While here, I couldn't help noticing that the claim that the bootstrap
superuser is the only initially-existing role has been a lie since
we started to invent predefined roles.  We don't want too much detail
in this very introductory text, but it seems worth changing it to say
that it's the only initially-existing login-capable role.

Per documentation comment from Maja Zaloznik.

Discussion: https://postgr.es/m/167931662853.3349090.18217722739345182859@wrigleys.postgresql.org
This commit is contained in:
Tom Lane 2023-03-26 14:48:04 -04:00
parent 554841699f
commit 6eefe2ce46

View File

@ -88,9 +88,13 @@ dropuser <replaceable>name</replaceable>
<para> <para>
To determine the set of existing roles, examine the <structname>pg_roles</structname> To determine the set of existing roles, examine the <structname>pg_roles</structname>
system catalog, for example system catalog, for example:
<synopsis> <synopsis>
SELECT rolname FROM pg_roles; SELECT rolname FROM pg_roles;
</synopsis>
or to see just those capable of logging in:
<synopsis>
SELECT rolname FROM pg_roles WHERE rolcanlogin;
</synopsis> </synopsis>
The <xref linkend="app-psql"/> program's <literal>\du</literal> meta-command The <xref linkend="app-psql"/> program's <literal>\du</literal> meta-command
is also useful for listing the existing roles. is also useful for listing the existing roles.
@ -98,11 +102,12 @@ SELECT rolname FROM pg_roles;
<para> <para>
In order to bootstrap the database system, a freshly initialized In order to bootstrap the database system, a freshly initialized
system always contains one predefined role. This role is always system always contains one predefined login-capable role. This role
a <quote>superuser</quote>, and by default (unless altered when running is always a <quote>superuser</quote>, and by default it will have
<command>initdb</command>) it will have the same name as the the same name as the operating system user that initialized the
operating system user that initialized the database database cluster, unless another name is specified while
cluster. Customarily, this role will be named running <command>initdb</command>.
It is common, but not required, to arrange for this role to be named
<literal>postgres</literal>. In order to create more roles you <literal>postgres</literal>. In order to create more roles you
first have to connect as this initial role. first have to connect as this initial role.
</para> </para>