Commit 009e422c authored by Bruce Momjian's avatar Bruce Momjian

doc: clarify hierarchy of objects: global, db, schema, etc.

The previous wording was confusing because it wasn't in decreasing order
and had to backtrack.  Also clarify role/user wording.

Reported-by: jbird@nuna.com

Discussion: https://postgr.es/m/158057750885.1123.2806779262588618988@wrigleys.postgresql.org

Backpatch-through: 9.5
parent 046fd4f3
...@@ -2625,19 +2625,18 @@ SELECT * FROM information WHERE group_id = 2 FOR UPDATE; ...@@ -2625,19 +2625,18 @@ SELECT * FROM information WHERE group_id = 2 FOR UPDATE;
</indexterm> </indexterm>
<para> <para>
A <productname>PostgreSQL</productname> database cluster A <productname>PostgreSQL</productname> database cluster contains
contains one or more named databases. Users and groups of users are one or more named databases. Roles and a few other object types are
shared across the entire cluster, but no other data is shared across shared across the entire cluster. A client connection to the server
databases. Any given client connection to the server can access can only access data in a single database, the one specified in the
only the data in a single database, the one specified in the connection connection request.
request.
</para> </para>
<note> <note>
<para> <para>
Users of a cluster do not necessarily have the privilege to access every Users of a cluster do not necessarily have the privilege to access every
database in the cluster. Sharing of user names means that there database in the cluster. Sharing of role names means that there
cannot be different users named, say, <literal>joe</literal> in two databases cannot be different roles named, say, <literal>joe</literal> in two databases
in the same cluster; but the system can be configured to allow in the same cluster; but the system can be configured to allow
<literal>joe</literal> access to only some of the databases. <literal>joe</literal> access to only some of the databases.
</para> </para>
......
...@@ -22,15 +22,13 @@ ...@@ -22,15 +22,13 @@
</indexterm> </indexterm>
<para> <para>
A database is a named collection of <acronym>SQL</acronym> objects A small number of objects, like role, database, and tablespace
(<quote>database objects</quote>). Generally, every database names, are defined at the cluster level and stored in the
object (tables, functions, etc.) belongs to one and only one <literal>pg_global</literal> tablespace. Inside the cluster are
database. (However there are a few system catalogs, for example multiple databases, which are isolated from each other but can access
<literal>pg_database</literal>, that belong to a whole cluster and cluster-level objects. Inside each database are multiple schemas,
are accessible from each database within the cluster.) More which contain objects like tables and functions. So the full hierarchy
accurately, a database is a collection of schemas and the schemas is: cluster, database, schema, table (or some other kind of object,
contain the tables, functions, etc. So the full hierarchy is:
server, database, schema, table (or some other kind of object,
such as a function). such as a function).
</para> </para>
......
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