PostgreSQL is an object-relational database system that has the features of traditional commercial database systems with enhancements to be found in next-generation DBMS systems. This blog entry documents the installation process of the PostgreSQL database on Ubuntu Linux.
Step 1: Verify that you do not already have PostgreSQL installed on your system
Run the following command in your console:
ps ax | grep postgres
If you get a response similar to the one below, then you have PostgreSQL installed.
Ss 0:00 postgres: writer process Ss 0:00 postgres: wal writer process Ss 0:00 postgres: autovacuum launcher process Ss 0:00 postgres: stats collector process
Step 2: Install PostgreSQL on your system
Run the following commands in your console:
sudo apt-get update sudo apt-get install postgresql-9.1
Step 3: Configure your postgresql password
sudo -u postgres psql template1 ALTER USER postgres with encrypted password 'your_password'; Press ctrl-d
Step 4: Configure MD5 authentication
sudo nano /etc/postgresql/9.1/main/pg_hba.conf
local all postgres
local all postgres md5
Step 5: Enable TCP/IP connections
sudo nano /etc/postgresql/9.1/main/postgresql.conf
Locate the line
#listen_addresses = 'localhost'
and change it to:
listen_addresses = 'localhost'
To allow other computers to connect to your PostgreSQL server replace ‘localhost’ with the IP Address of your server, or alternatively to ’0.0.0.0′ to bind to all interfaces.
Step 6: Restart postgres
sudo service postgresql restart