If you are using a pre-existing PostgreSQL server, review the memory guidance in this topic. For information about running PostgreSQL automatically, see Configuring PostgreSQL to run automatically.
-
Review your memory requirements in work_mem in the
postgresql.conf file in your PostgreSQL directory.
Increasing the work_mem value increases performance and allows PostgreSQL to perform larger in-memory sorting. For more information about PostgreSQL performance, see Tuning PostgreSQL.
-
Create a user named postgres that you will use to run PostgreSQL, and
ensure that this user has read permissions to the postgresql
Analytics installation directory and sub directories:
sudo useradd -m postgres
-
As the postgres user, initialize a storage area for your data; for
example:
initdb -D /usr/local/pgsql/data
where /usr/local/pgsql/data is the location you have chosen.If the postgres user does not have permission to create the storage area, you will need to create the directory as a root user, and change the owner to the postgres user, for example:
root# mkdir /usr/local/pgsql/data root# chown postgres /usr/local/pgsql/data root# su postgres postgres$ initdb -D /usr/local/pgsql/data
-
Navigate to the postgresql Analytics installation directory and as
the postgres user, start the database server:
postgres -D /usr/local/pgsql/data
To run PostgreSQL in the background, use the command:
postgres -D /usr/local/pgsql/data >logfile 2>&1 &
-
Check that PostgreSQL is running successfully by checking the log file (for example,
postgresql.out) in the postgresql/logs
directory.
See PostgreSQL support for more information on setting up and starting PostgreSQL.