3

I want to install PostgreSQL on a server that runs Ubuntu 14.04.2 LTS.

I understand that I have two options:

  1. Install PostgreSQL using the source code distribution
  2. Install PostgreSQL using apt-get install postgresql postgresql-contrib with these instructions.

Which option should I use?

  • Will there be a difference in the outcome?
  • Will both options result in the same set up and configuration (assuming I choose the default installation with option #1)?
  • Is there a situation where I would prefer option #1 over option #2 and vice versa?
Evan Carroll
  • 65,432
  • 50
  • 254
  • 507
dw8547
  • 947
  • 3
  • 11
  • 24

2 Answers2

3

If you install from apt-get you will be able to use apt-get upgrade option later and other apt-get build in options (available from Ubuntu). Furthermore apt-get installs binaries and manages their versions. You just install and nothing more.

Installing from source gives you the ability to do a more detailed installation. (You can customize the build and installation process with command line options connected to ./configure PARAMETERS LIST.) It's useful if you need a feature that can be enabled only by compiling the package yourself. Next thing is that installation from source may not be visible to apt-get commands so you may not be able to use them.

But if you need to install Postgres stable version without any specialized functionalities use apt-get option.

Michael Green
  • 25,255
  • 13
  • 54
  • 100
Czachovic
  • 162
  • 1
  • 10
0

For the purposes of this post, Ubuntu is used interchangeably with Debian.

PostgreSQL has a ton of dependencies. Building PostgreSQL means installing the headers for a lot of things. Alternatively, you can build those things too by yourself, but then down the rabbit hole you go. You can find a list of those things using apt-get depends postgresql-9.5

libgssapi-krb5-2
libldap-2.4-2
libpam0g
libssl1.0.0
libxml2
tzdata
ssl-cert
locales

Moreover, if you build PostgreSQL, then you'll have to build all of these things yourself independently if you ever need them.. (list generated with apt-cache rdepends postgresql-9.5

postgresql-9.5-dbg
postgresql-pltcl-9.5
postgresql-plpython3-9.5
postgresql-plpython-9.5
postgresql-plperl-9.5
postgresql-contrib-9.5
postgresql-9.5-dbg
postgresql-pltcl-9.5
postgresql-plpython3-9.5
postgresql-plpython-9.5
postgresql-plperl-9.5
postgresql-comparator
postgresql-9.5-slony1-2
postgresql-9.5-repmgr
postgresql-9.5-repack
postgresql-9.5-python3-multicorn
postgresql-9.5-python-multicorn
postgresql-9.5-prioritize
postgresql-9.5-preprepare
postgresql-9.5-prefix
postgresql-9.5-powa
postgresql-9.5-postgis-2.2
postgresql-9.5-plv8
postgresql-9.5-plsh
postgresql-9.5-plr
postgresql-9.5-plproxy
postgresql-9.5-pllua
postgresql-9.5-pgtap
postgresql-9.5-pgrouting
postgresql-9.5-pgq3
postgresql-9.5-pgpool2
postgresql-9.5-pgmp
postgresql-9.5-pgmemcache
postgresql-9.5-pgfincore
postgresql-9.5-pgextwlist
postgresql-9.5-partman
postgresql-9.5-orafce
postgresql-9.5-mysql-fdw
postgresql-9.5-mimeo
postgresql-9.5-ip4r
postgresql-9.5-debversion
postgresql-9.5-citus
postgresql-9.5-asn1oid
pg-rage-terminator-9.5
glom-utils
glom

On top of all that, your distribution will provide

  • upgrades to newer versions of PostgreSQL when new releases come out. And, not just access to those upgrades, but they'll show up with one-click upgrade, and through whatever notification systems you in the desktop environment or at the command line. Ubuntu provides them in motd-messages and taskbar-applications.
  • and, security patches for the version that they've frozen. In some cases the distribution may even back-port the security patches when the database drops support.

As to configuration, both versions will be configured slightly differently. As it relates to Ubuntu,

  • Ubuntu installs by default to a path that includes the source-distribution's version.
  • Ubuntu comes with different stock utilities that help you manage this

For a list of the management utilities provided by Ubuntu/Debian and their differences see this question,

Evan Carroll
  • 65,432
  • 50
  • 254
  • 507