Setting up postgresql tools and pgadmin in Ubuntu 14.04

One of the reasons why I write this rather basic and naive post is that while I was trying to setup pgadmin on my (K)ubuntu 14.04,  I felt there was lack of proper documentation on the process workflow. One among the other reasons is ofcourse the fact that once you learn something, it’s always nice to write/blog about it so as to assimilate it 😉

Required packages(install them using apt or whatever your distro uses)

  1. postgresql
  2. postgresql-contrib
  3. postgresql-client
  4. pgadmin3 (The GUI for managing your database)

Now comes the tricky part, as far as I’m concerned. The basic server setup. Since I’d be the only one using the database and I don’t really need it to be shared with anyone else, I’ve gone for the simpler setup. You can always refer to [1] if this blog post doesn’t answer your queries.
Open the terminal and type in the following ;

$ sudo -u postgres createuser --superuser $USER
$ sudo -u postgres psql 

On entering the above mentioned commands, you should be lead to a prompt like the follows,

postgres=# \password $USER

$ sudo -u createdb $USER
$ psql

Using the pgadmin3 GUI to manage databases can be done as follows. First launch the pgadmin from the command prompt by typing in.

$ pgadmin3

Once the GUI opens, click on connect in the top left corner(the plug kind of icon). That would lead you to the prompt like such.

Let the server be the localhost itself.
Let the server be the localhost itself.

Fill in the entries as shown in the screenshot and that should really do the trick. It sure did work for me 🙂

[1] https://help.ubuntu.com/community/PostgreSQL

Advertisements

5 thoughts on “Setting up postgresql tools and pgadmin in Ubuntu 14.04

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