Detailed installation guides

From PostgreSQL Wiki

Jump to: navigation, search

Contents

Any UNIX-Like Platform

Linux

PostgreSQL and SELinux

Debian/Ubuntu

Debian based installs have a somewhat unique design that allows multiple database clusters to be managed independently. This allows running both multiple database instances as well as multiple versions more easily than other packaging schemes.

RedHat/Fedora/CentOS

If you have the packages already installed on your server, RedHat installation can be as easy as:

service postgresql start

In older versions you'll automatically get a call to service postgresql initdb the first time you do this that will create the database cluster; in recent versions you'll need to do that yourself before the above.

You can turn on and off whether PostgreSQL starts at boot like this:

chkconfig postgresql on/off

The default network configuration that RedHat initdb specifies uses the 'ident' mechanism for controlling access to the database, which is often not what people want. See Client Authentication for more information.

RedHat defaults to creating the database in /var/lib/pgsql/data. If you want to change that, or otherwise want to adjust the parameters uses when PostgreSQL is started, you can do that by editing /etc/sysconfig/pgsql/postgresql and putting changes into there. This is a standard shell script file included into the environment; here is a sample with the default parameters, you can pick just the lines from here you want to change and put new values there:

PGDATA=/var/lib/pgsql/data
PGPORT=5432
PGLOG=/var/lib/pgsql/pgstartup.log
PGOPTS=

PGOPTS can be used to set random other options; it is added to the end of the command line used to run the postmaster daemon. But note that any configuration parameters set this way cannot be changed on-the-fly while the postmaster is running. It's usually better to set custom values in postgresql.conf.

Also, if you want to change PGDATA from the default, be aware that the default SELinux configuration in recent Red Hat releases will prevent the postmaster daemon from writing anywhere except /var/lib/pgsql/data. You'll need to change the SELinux setup or at least relabel directory security contexts to put it someplace else.

FreeBSD

MacOS

Solaris

Windows

Personal tools