Ubuntu Intrepd - PostgreSQL Install

This tutorial will walk you through installing PostgreSQL 8.3 on an Ubuntu Intrepid server. This tutorial assumes that you have completed the steps in this setup article.


The first step we need to do is install PostgreSQL 8.3 with the aptitude package manager. This will prompt you to install 40MB in packages.

sudo aptitude install postgresql

Server Setup

PostgreSQL is managed by one user and only that user is allowed to access the server. This user is called postgres. The first thing we need to do is change the password for this user. To do this we will have to impersonate the user and login with the psql command and change their password.

# sudo -u postgres psql postgres

You should be given a SQL prompt and a screen that looks something like the following:

Welcome to psql 8.3.4, the PostgreSQL interactive terminal.
Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit 


Type in the following command to change the password:

# ALTER USER postgres WITH ENCRYPTED PASSWORD '<your_password>';

** Replace <your_password> with your password **

You should receive an 'ALTER ROLE' statement back if it completed successfully. Now type the following to quit the SQL session:

# \q

That's it!

Congratulations! Your PostgreSQL server is now installed. Proceed to other knowledge base articles on how to perform various functions within PostgreSQL.

--Kelly Koehn 11:47, 26 March 2009 (CDT)

© 2015 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER