Before you can create a database in a database cluster, the filesystem must first be initialized. There are two ways to
initialize the filesystem for use with PostgreSQL; you may either use the
initdb
application to create
an entirely new database cluster (as was used to prepare your initial database system, in Chapter 2), or you may use the
initlocation
application to prepare a secondary
data directory.
A database cluster represents several associated databases. A single instance of the
postmaster
process can only access one database cluster at a time. Alternatively, through
initlocation
, you can
create databases that are part of an existing cluster that just happen to be stored in another data directory.
The following sections cover these two applications.