.\\" auto-generated by docbook2man-spec $Revision: 1.25 $ .TH "INITLOCATION" "1" "2002-11-22" "Application" "PostgreSQL Server Applications" .SH NAME initlocation \- create a secondary PostgreSQL database storage area .SH SYNOPSIS .sp \fBinitlocation\fR \fB\fIdirectory\fB\fR .SH "DESCRIPTION" .PP \fBinitlocation\fR creates a new PostgreSQL secondary database storage area. See the discussion under CREATE DATABASE [\fBcreate_database\fR(7)] about how to manage and use secondary storage areas. If the argument does not contain a slash and is not valid as a path, it is assumed to be an environment variable, which is referenced. See the examples at the end. .PP In order to use this command you must be logged in (using \fBsu\fR, for example) as the database superuser. .SH "EXAMPLES" .PP To create a database in an alternate location, using an environment variable: .sp .nf $ \fBexport PGDATA2=/opt/postgres/data\fR .sp .fi Stop and start postmaster so it sees the \fBPGDATA2\fR environment variable. The system must be configured so the postmaster sees \fBPGDATA2\fR every time it starts. Finally: .sp .nf $ \fBinitlocation PGDATA2\fR $ \fBcreatedb -D PGDATA2 testdb\fR .sp .fi .PP Alternatively, if you allow absolute paths you could write: .sp .nf $ \fBinitlocation /opt/postgres/data\fR $ \fBcreatedb -D /opt/postgres/data/testdb testdb\fR .sp .fi .SH "SEE ALSO" \fIPostgreSQL Administrator's Guide\fR