HostOnNet Blog

How to Install PostgreSQL 9.2 on Ubuntu 13.04 (Raring Ringtail) Server

PostgreSQL, often simply Postgres, is an object-relational database management system (ORDBMS) available for many platforms including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software. PostgreSQL is developed by the PostgreSQL Global Development Group, consisting of a handful of volunteers employed and supervised by companies such as Red Hat and EnterpriseDB. It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby, Tcl, ODBC, among others.

What is new in version 9.2

This release has been largely focused on performance improvements, though new SQL features are not lacking. Work also continues in the area of replication support. Major enhancements include:

  • Allow queries to retrieve data only from indexes, avoiding heap access (index-only scans)
  • Allow the planner to generate custom plans for specific parameter values even when using prepared statements
  • Improve the planner’s ability to use nested loops with inner index scans
  • Allow streaming replication slaves to forward data to other slaves (cascading replication)
  • Allow pg_basebackup to make base backups from standby servers
  • Add a pg_receivexlog tool to archive WAL file changes as they are written
  • Add the SP-GiST (Space-Partitioned GiST) index access method
  • Add support for range data types
  • Add a JSON data type
  • Add a security_barrier option for views
  • Allow libpq connection strings to have the format of a URI
  • Add a single-row processing mode to libpq for better handling of large result sets

Install PostgreSQL 9.2 on Ubuntu 13.04 Server

Create /etc/apt/sources.list.d/pgdg.list

sudo vi /etc/apt/sources.list.d/pgdg.list

and add the following line

deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main

Save and exit the file

Add the GPG key

wget --quiet -O -- http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -

Update the source list

sudo apt-get update

Install PostgreSQL

sudo apt-get install postgresql-common -t raring

sudo apt-get install postgresql-9.2

You can check the PostgreSQL version using the following command

psql --version

Posted in Linux, Ubuntu