How to install postgresql on your Ubuntu machine

Let’s install Postgresql via Synaptic.

Open Synaptic package manager and select the following:

  1. postgresql (9.1 in this case)
    • mark all additional changes
  2. I also check postgresql-server-dev
    • mark all additional changes

Apply and install everything.

The next step is to setup a password for the postgres user (the default user).

To do this open your Terminal and type:

sudo su postgres

(put in sudo password)

Once in the postgres user shell type:

psql

now type in

ALTER USER postgres WITH PASSWORD 'mysupersecretpassword';

you should see the result ALTER ROLE
type \q to quit psql then type

exit

to exit the postgres shell and return to your normal shell.

Your postgres user is now configured for your postgresql install on your Ubuntu machine.

Some people like to manage their Postgres Databases via the terminal. Other people like me prefer a graphical user interface (GUI). If you prefer the GUI method then you will want to install and configure Pgadmin3. Here is a post on how to do that.

About these ads

One thought on “How to install postgresql on your Ubuntu machine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s