INITLOCATION(1)                                   INITLOCATION(1)

       initlocation  - Create a secondary Postgres database stor-
       age area

       initlocation [ --location=er">alble> | -D altdir ]
           [ --username=name | -u name ]
           [ altdir ]


       -D altdir

       altdir Where in your Unix filesystem do you want alternate
              databases to go?  The top level directory is called
              the PGDATA directory, so you might  want  to  point
              your first alternate location at PGDATA2.


       -u name

       PGUSER Who  will  be  the  Unix  filesystem  owner of this
              database storage area?  The Postgres superuser is a
              Unix  user  who  owns  all  files  that  store  the
              database system and also owns  the  postmaster  and
              backend  processes that access them.  Usually, this
              is the user who should  run  initlocation  and  who
              will  thus  have  ownership  of the directories and

              Note: Only the Unix superuser can create a database
              system  with a different user as the Postgres supe-
              ruser.  Specifying a user other than  the  Postgres
              superuser  may  lead  to database security and data
              integrity problems. Refer to the PostgreSQL  Admin-
              istrator's Guide for more information.

       initlocation  will  create  directories  in  the specified

       We are initializing the  database  area  with  username
              postgres (uid=500).
              Successful completion.

       We are initializing the  database  area  with  username
              postgres (uid=500).
              You do not have filesystem permission to  write  to
              the specified directory area.

       Valid username not given. You must specify the username
              The username which you have specified  is  not  the
              Postgres superuser.

       Can't tell what username to use. You don't have the USER
              Specify the --username command line option.

       initlocation  creates  a  new  Postgres secondary database
       storage  area.   A  secondary  storage  area  contains   a
       required tree of directories with the correct file permis-
       sions on those directories.

       Creating a database storage area consists of creating  the
       directories in which database data might live.

       There are two kinds of arguments for initlocation.  First,
       you can specify an environment  variable  (e.g.  PGDATA2).
       This  environment  variable should be known to the backend
       for later use in CREATE DATABASE/WITH LOCATION or createdb
       -D  altdir.   However,  the  backend daemon must have this
       variable in it's environment for this to succeed.  Second,
       you  may  be  able to specify an explicit absolute path to
       the top directory of the storage area. However,this second
       option  is  possible only if explicitly enabled during the
       Postgres installation. It is usually disabled to alleviate
       security and data integrity concerns.


              Postgres  will  add /base/ to the specified path to
              create the storage area.

              The backend requires  that  any  argument  to  WITH
              LOCATION which is in all uppercase and which has no
              path delimiters is an environment variable.

       To create a database in an alternate  location,  using  an
       environment variable:

       % setenv PGDATA2 /opt/postgres/data
       % initlocation PGDATA2
       % createdb -D PGDATA2

Application               15 August 1999                        1