Database Reference
In-Depth Information
5. Thereisonethingintheprivilegesof
chapter10
thatmaybeofconcernto
us.
=Tc/postgres
6. Unliketheprivilegelistingsfor
group1
and
group2
,thislistinghasnovalue
before the equal sign (
=
). This listing is for the special
public
metagroup,
whichisbuiltintoPostgreSQLandtowhichallusersandgroupsautomatic-
ally belong.
7. We don't want everyone to have access to the
chapter10
database. So,
weneedtousethe
REVOKE
statementtoremoveprivilegesfromthe
public
metagroup by executing the following command:
REVOKE ALL ON DATABASE chapter10 FROM
public;
8. Let's see what the initial privileges are for the schemas of the
chapter10
database by executing the following command:
chapter10=# \dn+
List
of schemas
Name | Owner | Access
privileges | Description
--------------------+----------+----------------------+----------------------------------
postgis | postgres
| |
public | postgres |
postgres=UC/postgres+| standard public
schema
| | =UC/
postgres |
9. The
postgis
schema has no privileges listed. This does not mean that
no one can access the
postgis
schema though. Only the owner of the
schema—
postgres
,inthiscase—canaccessit.Wewillgrantaccesstothe
postgis
schema to both
group1
and
group2
by executing the following
command: