martedì 1 febbraio 2011

Install PostgreSQL 9.0 on Ubuntu 10.10


 PostgreSQL 9.0 final was released on 2010/09/20 which I’ve been waiting for to begin playing with it and evaluating it. The mainline Ubuntu Lucid apt repositories only have 8.4. According to the package maintainer, Martin Pitt, the postgresql-9.0 package won’t be added until Ubuntu Natty. Thankfully, he setup a backports repo for Ubuntu that we can pull from.

This is a very quick and painless process. If you have not done so already, make your life easier by installing python-software-properties:

sudo apt-get install python-software-properties


Next up is adding the backports repo and updating apt:

sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update



UPDATE: In the comments, Jason Froebe points out that if you already have an earlier version of PostgreSQL installed, you can just upgrade it:

sudo apt-get upgrade

Finally install postgresql-9.0:


sudo apt-get install postgresql-9.0 libpq-dev
The libpq-dev package is for compiling wrappers/clients against libpq.
There you’re done!

NOTE:
Default config directory is: /etc/postgresql/9.0/main
Default data directory is: /var/lib/postgresql/9.0/main


This installs the engine and pgadmin3 client, a graphical tool to manage databases.
The next thing is to change the administrator password system PostgreSQL:
sudo passwd postgres
Now we must change the password of "user postgres" on the engine, it first entered with the following line:
psql -h localhost -U postgres -W template1
or 
sudo su postgres -c psql template1
and then enter the following command:
ALTER USER postgres WITH PASSWORD 'password';
Finally out of postgres, enter the following command:
\q
With this we have installed PostgreSQL. Settings
We set up remote access to our motor. This step is optional, only if you want to allow access to our server from other hosts.
First we edit the file postgresql.conf:
sudo gedit /etc/postgresql/9.0/main/postgresql.conf
Look for the line:
# Listen_addresses = 'localhost'
and change it to:
listen_addresses = '*'
We also look for the following line:
# Password_encryption = on
and change it to:
password_encryption = on
Now we edit the file "pg_hba.conf"
sudo gedit /etc/postgresql/9.0/main/pg_hba.conf
 
Modify the lines:

# Database administrative login by UNIX sockets
local   all         postgres                          ident

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               ident
# IPv4 remote connections:
host    all         all         194.116.73.46/0          md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

We do this to use MD5 authentication with the user postgres.

Finally sent to restart:
sudo /etc/init.d/postgresql restart
More information about the configuration: http://www.linux-es.org/node/660

pgAdmin 1.12 for Ubuntu 10.04, Postgres 9.0

Download and install!

pgadmin3-data_1.12.0-1_all.deb
pgadmin3_1.12.0-1_i386.deb
pgadmin3_1.12.0-1_amd64.deb

29 commenti:

  1. nicely done... thank you much

    RispondiElimina
  2. all your tutorials are amazing, update and works perfectly. great work.

    RispondiElimina
  3. I am always searching for informative information like this. Thanks for sharing with us........ by OPS 571 Final Exam provider.

    RispondiElimina
  4. Pretty! This was an incredibly wonderful article. Many thanks for providing this info.. ..... by BIS 220 Week 5 provider.

    RispondiElimina
  5. I am very much pleased with the contents you have mentioned. It contains truly information. I want to thank you for this informative read; I really appreciate for sharing this great post......by ETH 316 Final provider



    RispondiElimina
  6. The first thing is that you have to plan your time. It means that you have to share your study load on all of the months of the semester. When doing so you have already acquired the required knowledge before the exam day approaches....for more information you can also go through
    MGT 498 Week 4

    RispondiElimina
  7. Thank you for these bright instructions.The account is accessible to understand. It formed for me. Thank you.by ETH 316 Final provider


    RispondiElimina
  8. Thanks for sharing this terribly informative post! this can be therefore fascinating to know. I really love reading your stuff being sent here.by LDR 531 Week 3 Assignment

    RispondiElimina
  9. The first thing is that you have to plan your time. It means that you have to share your study load on all of the months of the semester. When doing so you have already acquired the required knowledge before the exam day approaches....for more information you can also go through
    MGT 498

    RispondiElimina
  10. A actual acceptable and absorbing column that i accept appear across, acknowledgment for administration the post.Really appreciable.by ETH 316 Week 2 Team Assignment provider



    RispondiElimina
  11. Thank you for these ablaze instructions.The annual is attainable to understand. It formed for me. Thank you

    by ETH 316 Week 3 Team Assignment provider

    RispondiElimina
  12. this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information…....by ETH 316 Week 4 Team Assignment provider

    RispondiElimina
  13. Not so far I have found new cool tool to work with PostgreSQL on ubuntu — Valentina Studio. Its free edition can do things more than many commercial tools!!
    I very recommend check it. http://www.valentina-db.com/en/valentina-studio-overview

    RispondiElimina
  14. This is a nice article..Its actual accessible to accept ..And this commodity is application to apprentice article about it..by MGT 521 provider



    RispondiElimina
  15. I am actual abundant admiring with the capacity you accept mentioned. It contains absolutely information. I appetite to acknowledge you for this advisory read; I absolutely acknowledge for administration this abundant post....by
    MGT 420 Week 2 provider.

    RispondiElimina
  16. Your Blog is really appreciable. You did a great job by sharing this valuable and helpful Article with us........ by MGT 311 Final Exam provider.

    RispondiElimina
  17. I have discover some good stuff here. decisively price bookmarking for revisiting. i ponder however a allotment try you set to make the kind of glorious informative web site.RES 342 Week 4

    RispondiElimina
  18. This is the really good informative Post on Blogger and I really like to read it. Thanks for Presenting with us. by
    MGT 311 week 3 Individual Assignment provider.

    RispondiElimina
  19. This is a nice article..Its absolute attainable to acquire ..And this commodity is appliance to amateur commodity about it..by
    MGT 420 provider.

    RispondiElimina
  20. fantastic and advantageous we acknowledgment for publishing advantageous and advice abundant to apprehend it. by
    mgt 311 entire course provider.

    RispondiElimina
  21. Thank u for sharing this valuable information to every one , nice piece of information....by
    MGT 420 Final Exam provider.

    RispondiElimina
  22. Thank you so much for providing this valuable information. It is very important to us. You Posted a Good Stuff... by MGT 521 Entire Course provider

    RispondiElimina
  23. The column is actual informative. It is a amusement account it. I accept additionally bookmarked you for blockage out fresh posts. acknowledgment for assuming my animadversion in your armpit ...... by
    mth221week5 provider.

    RispondiElimina
  24. Thank you so much for providing this valuable information. It is very important to us. You Posted a Good Stuff... by
    mth221week1 provider.

    RispondiElimina
  25. Impressive thoughts and your commodity adviser me lots about convenance of some seo basics and one of the best affair is you shares some absorbing being which is actual advantageous for me....
    mth221week2 provider.

    RispondiElimina
  26. Great abstraction for the afterimage of the websites...Its actual accessible to accept ..And this commodity is application to apprentice article about it..
    mth221week3 provider.

    RispondiElimina
  27. Nice work! Your column is an accomplished archetype of why I accumulate advancing aback to apprehend your accomplished affection agreeable that is always updated....by
    mth221week4 provider.

    RispondiElimina
  28. thanks for sharing, i feel useful from this coimbatore website designing company

    RispondiElimina
  29. thanks for providing this information as i was searching for it. Really Helpful.. ECO 372 Final Exam

    RispondiElimina