If you are not interested in creating a new database cluster, but simply wish to store a particular database in a
different data directory, use
initlocation
. The
initlocation
program creates the
directories needed for a secondary database storage area. For more information on how to create a database in a secondary
data storage area, refer to the Section called Creating and Removing a Database
" later in this chapter. Here is the syntax for
initlocation
:
initlocation
directory
In this syntax,
directory
is the path for the new secondary database location. This command
should be run as the user which runs the
postmaster
, so that it will have the necessary rights in the
created path.
Example 9-8 demonstrates how to initialize a secondary database storage
area in the
/usr/local/pgsql/booktown2
directory:
Example 9-8. Initializing a Secondary Database Location
[postgres@booktown ~]$
initlocation /usr/local/pgsql/booktown2