Postgresql 9.6 Installation Guide
Postgresql 9.6 Installation Guide
Postgresql 9.6 Installation Guide
6 Installation Guide
Table of Contents
1 Introduction ................................................................................................................. 4
1.1 Typographical Conventions Used in this Guide ................................................. 5
2 Requirements Overview.............................................................................................. 6
2.1 Hardware Requirements...................................................................................... 7
2.2 Software Prerequisites ........................................................................................ 7
3 Installing PostgreSQL with the Graphical Installation Wizard .................................. 9
3.1 Invoking the Graphical Installer ....................................................................... 10
4 Using Stack Builder .................................................................................................. 19
5 Invoking the Installer from the Command Line ....................................................... 25
5.1 Performing a Text Mode Installation ................................................................ 25
5.2 Performing an Unattended Installation ............................................................. 28
6 Reference - Command Line Options ........................................................................ 30
7 Uninstalling PostgreSQL .......................................................................................... 34
7.1 Uninstalling PostgreSQL on a Linux System ................................................... 34
7.2 Uninstalling PostgreSQL on a Windows System ............................................. 36
8 Installation Troubleshooting ..................................................................................... 38
8.1 Installation Log Files ........................................................................................ 38
1 Introduction
The PostgreSQL installers created by EnterpriseDB are designed to make it quick and
simple to install PostgreSQL on your computer. The installer provides:
The sections that follow provide information about using the PostgreSQL 9.6 installer:
In the following descriptions a term refers to any word or group of words that are
language keywords, user-supplied values, literals, etc. A terms exact meaning depends
upon the context in which it is used.
Italic font introduces a new term, typically, in the sentence that defines it for the
first time.
Fixed-width (mono-spaced) font is used for terms that must be given
literally such as SQL commands, specific table and column names used in the
examples, programming language keywords, etc. For example, SELECT * FROM
emp;
Italic fixed-width font is used for terms for which the user must
substitute values in actual usage. For example, DELETE FROM table_name;
A vertical pipe | denotes a choice between the terms on either side of the pipe. A
vertical pipe is used to separate two or more alternative terms within square
brackets (optional choices) or braces (one mandatory choice).
Square brackets [ ] denote that one or none of the enclosed term(s) may be
substituted. For example, [ a | b ], means choose one of a or b or neither
of the two.
Braces {} denote that exactly one of the enclosed alternatives must be specified.
For example, { a | b }, means exactly one of a or b must be specified.
Ellipses ... denote that the proceeding term may be repeated. For example, [ a |
b ] ... means that you may have the sequence, b a a b a.
2 Requirements Overview
PostgreSQL 9.6 is certified on the following platforms:
32 bit Windows:
Windows 7, 8, and 10
64 bit Windows:
Windows 7, 8, and 10
Windows 2012
Windows 2008
32 bit Linux:
CentOS 6.x
Ubuntu 14.04
64 bit Linux:
Debian 7 and 8
SLES 12
Ubuntu 14.04
MAC OS X:
a 1 GHz processor
1 GB of RAM
512 MB of HDD
User Privileges
On a Linux or Mac system, you must have superuser privileges to perform a PostgreSQL
installation. To perform an installation on a Windows system, you must have
administrator privileges.
If you are installing PostgreSQL into a Windows system that is configured with User
Account Control (UAC) enabled, you can assume sufficient privileges to invoke the
graphical installer by right clicking on the name of the installer and selecting Run as
administrator from the context menu. If prompted, enter an administrator password
to continue.
You must install xterm, konsole, or gnome-terminal before executing any console-
based program installed by the PostgreSQL installer.
SELinux Permissions
Before installing PostgreSQL on a system that is running SELinux, you must set SELinux
to permissive mode.
The following example works on Redhat Enterprise Linux, Fedora Core or CentOS
distributions. Use comparable commands that are compatible with your Linux
distribution to set SELinux to permissive mode during installation and return it to
enforcing mode when installation is complete.
Before installing PostgreSQL, set SELinux to permissive mode with the command:
# setenforce Permissive
When the installation is complete, return SELinux to enforcing mode with the
command:
# setenforce Enforcing
Be sure to apply Windows operating system updates before invoking the PostgreSQL
installer. If (during the installation process) the installer encounters errors, exit the
installation, and ensure that your version of Windows is up-to-date before restarting the
installer.
The Mac OS X installer is an App Bundle (a set of files and directories in a prescribed
format). To ensure the App Bundle can be downloaded, it is packaged inside a disk
image (.dmg) file. To extract the installer, simply mount the disk image and copy the
installer to the desired location, or run it directly from the disk image.
By default, Mac OS X ships with shared memory settings that are too low for running
PostgreSQL. The installer will detect this, and if possible, reconfigure shared memory
and then prompt you to reboot the system and rerun the PostgreSQL installer. For more
information, please see the README file in the distribution disk image.
Note that if you are invoking the graphical installer to perform a system upgrade, the
installer will preserve the configuration options specified during the previous installation.
When the PostgreSQL installation finishes, you will be offered the option to invoke the
Stack Builder package manager. Stack Builder provides an easy-to-use graphical
interface that downloads and installs applications, drivers and utilities and their
dependencies. See Section 4 for more information about using Stack Builder.
The graphical PostgreSQL installer is available from the EnterpriseDB website at:
http://www.enterprisedb.com/downloads/postgres-postgresql-downloads
After navigating to the Product Downloads page, select the PostgreSQL tab, and then
choose the PostgreSQL installer that corresponds to your platform. When the download
completes, extract the files using a system-specific file extractor.
Section 3.1 demonstrates using the setup wizard to install PostgreSQL on a Windows
system. You can follow the same procedure to install PostgreSQL on a Linux or Mac
system.
Note that in some versions of Windows, you can invoke the installer with
Administrator privileges by right clicking on the installer icon and selecting Run as
Administrator from the context menu.
Click Next to continue. The Installation Directory window (Figure 3.2) opens.
Accept the default installation directory, or specify an alternate location and click Next
to continue.
Accept the default location or specify the name of the alternate directory in which you
wish to store the data files, and click Next to continue.
PostgreSQL uses the password specified on the Password window for both the database
superuser and the PostgreSQL service account.
The specified password must conform to any security policies existing on the
PostgreSQL host. After entering a password in the Password field, and confirming the
password in the Retype Password field, click Next to continue.
Use the Port field to specify the port number on which the server should listen. The
default listener port is 5432 (shown in Figure 3.5). Click Next to continue.
Use the Locale field to specify the locale that will be used by the new database cluster.
The Default locale is the operating system locale (shown in Figure 3.6). Click Next
to continue.
The wizard will inform you that it has the information required to install PostgreSQL (see
Figure 3.7); click Next to continue.
During the installation, the setup wizard confirms the installation progress of PostgreSQL
via a series of progress bars (see Figure 3.8).
Before the setup wizard completes the PostgreSQL installation, it offers to Launch
Stack Builder at exit (see Figure 3.9).
Figure 3.9 The installation wizard offers to Launch Stack Builder at exit.
You can optionally uncheck the Stack Builder box and click Finish to complete the
PostgreSQL installation or accept the default and proceed to Stack Builder.
The Stack Builder utility provides a graphical interface that downloads and installs
applications and drivers that work with PostgreSQL. You can invoke Stack Builder at
installation time or (after the installation completes) through the PostgreSQL 9.6 menu.
For more information about Stack Builder, see Section 4, Using Stack Builder.
Stack Builder requires Internet access; if your installation of PostgreSQL resides behind a
firewall (with restricted Internet access), Stack Builder can download program installers
through a proxy server. The module provider determines if the module can be accessed
through an HTTP proxy or an FTP proxy; currently, all updates are transferred via an
HTTP proxy and the FTP proxy information is not used.
You can invoke Stack Builder at any time after the installation has completed by
selecting the Application Stack Builder menu option from the PostgreSQL 9.6
menu. Enter your system password (if prompted), and the Stack Builder welcome
window opens (shown in Figure 4.1).
Use the drop-down listbox on the welcome window to select your PostgreSQL
installation.
If the selected PostgreSQL installation has restricted Internet access, use the Proxy
Servers button on the Welcome window to open the Proxy servers dialog (shown in
Figure 4.2).
Enter the IP address and port number of the proxy server in the HTTP proxy or FTP
proxy fields on the Proxy servers dialog. Currently, all Stack Builder modules are
distributed via HTTP proxy (FTP proxy information is ignored). Click OK to continue.
The tree control on the Stack Builder module selection window (shown in Figure 4.3)
contains a node for each module category; click on a category heading to expose the
modules within that category (as shown in Figure 4.4).
Each entry within the tree control is the name of a module that can be installed with Stack
Builder.
If the module is installed, you will see the word (installed) to the right of the
module name.
If a module name is in bold type, the installer has detected a mismatch between
the available version and the installed version.
Boxes next to the modules that are already installed, but eligible for update are
automatically checked.
To add new modules to the selected PostgreSQL installation, check the box to the left of
the module name and click Next.
The Selected packages window confirms the packages selected (Figure 4.5).
The package installers are downloaded to the directory specified in the Download
directory field. Use the button to the right of the Download directory field to open
a file selector, and choose an alternate location in which to store the downloaded
installers.
Click Next to connect to the server and download the required installation files. (see
Figure 4.6).
Figure 4.6 Stack Builder is downloading installation files for the specified packages.
When the downloads complete, a window opens confirming that the installation files
have been downloaded and are ready for installation (see Figure 4.7).
You can check the box next to Skip Installation, and select Next to exit Stack
Builder without installing the downloaded files, or leave the box unchecked and click
Next to start the installation process.
Each downloaded installer has different requirements. As the installers execute, they
may prompt you to confirm acceptance of license agreements, to enter passwords, and
enter configuration information.
During the installation process, you may be prompted by one (or more) of the installers to
restart your system. Select No or Restart Later until all installations are completed.
When the last installation has completed, re-boot the system to apply all of the updates.
You may occasionally encounter packages that dont install successfully. If a package
fails to install, Stack Builder will alert you to the installation error with a popup dialog,
and write a message to the log file at:
On Windows: %TEMP%
On Linux: /tmp
When the installation is complete, the installer will alert you to the success or failure of
the installations of the requested packages. If you were prompted by an installer to restart
your computer, re-boot now.
Please note: The modules supported by Stack Builder are subject to change and vary by
platform.
Include the --mode text option when invoking the installer to perform an
installation from the command line.
Include the --mode unattended option when invoking the installer to perform
an installation without user input.
Please Note: If you are invoking the installer from the command line to perform a system
upgrade, the installer will ignore command line options, and preserve the configuration of
the previous installation.
To specify that the installer should run in text mode, include the --mode text command
line option when invoking the installer. Text-mode installations are useful if you need to
install on a remote server using ssh tunneling (and have access to a minimal amount of
bandwidth), or if you do not have access to a graphical interface.
In text mode, the installer uses a series of command line questions to establish the
configuration parameters. Text-mode installations are valid only on Linux or Mac
systems.
When the installation begins, the text mode installer welcomes you to the Setup Wizard:
----------------------------------------------------------------
Welcome to the PostgreSQL Setup Wizard.
----------------------------------------------------------------
----------------------------------------------------------------
Please specify the directory where PostgreSQL will be installed.
----------------------------------------------------------------
Enter an alternate location, or press Enter to accept the default and continue. The
default location of the data directory is /opt/PostgreSQL/9.6/data:
----------------------------------------------------------------
Please select a directory under which to store your data.
----------------------------------------------------------------
Enter an alternate location, or press Enter to accept the default and continue. The
default location of the data directory is /opt/PostgreSQL/9.6/data:
----------------------------------------------------------------
Please provide a password for the database superuser (postgres).
A locked Unix user account (postgres) will be created if not
present.
Password :
Retype password :
----------------------------------------------------------------
The specified password must conform to any security policies (minimum length, use of
special characters, and so on) in place on the host. After entering a password in the
Password field, confirm the password and press Enter to continue.
When prompted, enter the Port that the PostgreSQL service will monitor for
connections:
----------------------------------------------------------------
Please select the port number the server should listen on.
Port [5432]:
----------------------------------------------------------------
By default, PostgreSQL selects the first available port after port 5432.
When prompted, specify a Locale by entering a locale number from the list shown
----------------------------------------------------------------
[715] zh_TW.utf8
[716] zu_ZA
[717] zu_ZA.iso88591
[718] zu_ZA.utf8
Please choose an option [1] :
----------------------------------------------------------------
Press Enter to accept the Default locale value and instruct the installer to use the
system locale as the server locale.
When the setup wizard has gathered the information that it needs to perform the
installation, it will prompt you that it is ready to begin installing PostgreSQL:
----------------------------------------------------------------
Setup is now ready to begin installing PostgreSQL on your
computer.
----------------------------------------------------------------
Please wait while Setup installs PostgreSQL on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
----------------------------------------------------------------
Setup has finished installing PostgreSQL on your computer.
To specify that the installer should run without user interaction, include the --mode
unattended command line option. In unattended mode, the installer uses one of the
following sources for configuration parameters:
You can embed the non-interactive PostgreSQL installer within another application
installer; during the installation process, a progress bar displays for the user (shown in
Figure 5.9).
Figure 5.9 Using --mode unattended displays a progress bar to the user.
You must have superuser privileges to install PostgreSQL using the --mode
unattended option on a Linux or Mac system. On a Windows system, administrative
privileges are required. If you are using the --mode unattended option to install
PostgreSQL with another installer, the calling installer must be invoked with superuser or
administrative privileges.
To start the installer in unattended mode, specify the --mode unattended option on
the command line.
On Windows
To start the installer in unattended mode on a Windows system, navigate to the directory
that contains the executable file, and enter:
on some Windows systems, and enforced password policies may not accept the default
password (postgres).
On Linux
To install in unattended mode on a Linux machine, navigate to the directory that contains
the PostgreSQL installer and enter:
The --superpassword option specifies a password for the database superuser. If you
omit the option, the database superuser password defaults to postgres. The default
password can be easily guessed by a potential intruder; be sure to provide a stronger
password with the --superpassword option.
You can control configuration parameters for PostgreSQL by specifying options at the
command line, or by including the parameters in a configuration file. Specify the
parameters within the configuration file in option=value pairs (shown in Figure 5.10).
When you invoke the installer, include the --optionfile parameter, and the complete
path to the configuration parameter file:
# ./postgres-version-platform.run --optionfile
/$HOME/config_param
For more information about the command line options supported during an unattended
installation, see Section 6, Reference - Command Line Options.
--create_shortcuts
--datadir data_directory
Use the --datadir parameter to specify a location for the cluster's data
directory. data_directory is the name of the directory; include the complete
path to the desired directory.
--debuglevel { 0 | 1 | 2 | 3 | 4 }
Use the --debuglevel parameter to set the level of detail written to the
debug_log file (see --debugtrace). Higher values produce more detail (and a
longer trace file). The default is 2.
--debugtrace debug_log
--disable-stackbuilder {yes|no}
--extract-only {yes|no}
--help
--installer-language {en|es|fr}
en (English)
es (Spanish)
fr (French)
--install_plpgsql
--install_runtimes { yes | no }
--locale locale
Specifies the locale for the PostgreSQL cluster. By default, the installer will use
to the locale detected by initdb.
Use the --mode parameter to specify an installation mode. The following modes
are supported:
gtk - Specify gtk to tell the installer to use the GTK graphical toolkit.
xwindow - Specify xwindow tell the installer to use the X Window graphical
toolkit.
--optionfile config_file
Use the --optionfile parameter to specify the name of a file that contains the
installation configuration parameters. config_file must specify the complete
path to the configuration parameter file.
--prefix installation_dir
/opt/PostgreSQL/9.6
C:\Program Files\PostgreSQL\9.6
--serverport port_number
If you are installing PostgreSQL in unattended mode, and do not specify a value
using the --serverport parameter, the installer will use port 5432, or the first
available port after port 5432 as the default listener port.
--serviceaccount user_account_name
Use the --serviceaccount parameter to specify the name of the user account
that owns the server process. The default value of --serviceaccount is set to
postgres.
Please note that for security reasons, the --serviceaccount parameter must
specify the name of an account that does not hold administrator privileges.
--servicename service_name
--servicepassword user_password
--superaccount super_user_name
Use the --superaccount parameter to specify the user name of the database
superuser. The default value of --superaccount is set to postgres.
--superpassword superuser_password
--version
7 Uninstalling PostgreSQL
The PostgreSQL installer creates an uninstaller in the installation directory. On Linux or
Mac, the name of the uninstaller is:
uninstall-postgresql
/opt/PostgresPlus/9.6AS
uninstall-postgresql.exe
C:\Program Files\PostgreSQL\9.6
./uninstall-postgresql
The uninstaller will open a popup, asking you to confirm that you wish to uninstall
PostgreSQL (see Figure 7.1).
If you selected Yes, the uninstaller opens, and proceeds to remove PostgreSQL (see
Figure 7.2).
When the uninstaller completes, a Warning notifies you that the data directory and
service user account have not been removed (see Figure 7.3).
Figure 7.3 Confirming database objects that have not been removed.
Click OK to close the Warning; an Info popup informs you that the uninstallation is
complete (see Figure 7.4)
Right click on PostgreSQL 9.6, and select Uninstall/Change from the context
menu. When prompted, confirm that you wish to uninstall PostgreSQL (see Figure 7.2).
Figure 7.2 A dialog asks you to confirm that you wish to remove PostgreSQL.
Please note that uninstalling PostgreSQL will leave the data directory and database
service user intact; when prompted, click OK to continue (see Figure 7.3).
Figure 7.3 A popup confirms that the data directory and service user account have not
been removed from the host system.
When PostgreSQL has been removed, an Info dialog opens to confirm (as shown in
Figure 7.4). Click OK to exit.
8 Installation Troubleshooting
--mode unattended Authentication Errors
If you encounter an error during the installation process on a Windows system, exit the
installation, and ensure that your version of Windows is up-to-date. After applying any
outstanding operating system updates, re-invoke the PostgreSQL installer.
If applications fail to launch (such as Stack Builder or your web browser) during the
installation process on a Linux or Unix system, verify that the xdg-open program is on
your system. If xdg-open is missing, install the xdg-utils package.
If you are using the GNOME desktop, load the root profile before running the
PostgreSQL installation script. To load the root profile, issue the command, su - root
instead of su root before installing PostgreSQL.
%TEMP% on Windows
The installation log file is called install-postgresql.log. The logfile may contain
the superuser password specified during the installation, which should be replaced before
sharing the log with anyone.
If you are unable to resolve the problem after reviewing the logfile, please search the
EnterpriseDB forums or your favourite search engine for a solution. If you still cannot
resolve the issue, please post details of the problem, along with system details and any
appropriate parts of the installation logfile to the installer forum.