Direkt zum Hauptbereich

How to install Postgresql 9.0 on Ubuntu 10.10

If you wan't to take advantage of the latest Version of the famous Postgresql Database Server (9.0.3 at the time of writing this post) on Ubuntu 10.10 (Maverick), you might probably find out that the Ubuntu Software Center does not include this version yet.

Fortunately it can be installed easily with the apt system and the packages provided by Martin Pitt. Just follow the steps described below.

Step 1. Add the PPA to your system

PPA is the abbreviation for "Personal Package Archive" and is a service on Launchpad, a software collaboration platform to share pre-build packages for different Linux architectures and distributions.

A PPA needs to be recognized by apt (Advanced Packaging Toolkit), therfore you need to introduce it and it's signing key. In a terminal window type:

sudo add-apt-repository ppa:pitti/postgresql

The result should look similar to this screenshot.



Now, you should tell your system to pull down the latest list of software from each archive it knows about, including the PPA you just added.

sudo apt-get update

If you no take a look at the available packeages, r.g. with the Synaptic Packet Manager, you will see that several Postgresql 9 packages are available.

Step 2: Install Postgresql


Now you are prepared to install Postgresql with apt:

sudo apt-get install postgresql-9.0

You will see a list of the packages which will be installed and upgraded. Confirm with "Y", if you wan't to go on. Now the installation will take place.

Several tasks are done during the installation. To have a better understanding what's going on, here are the most important:
  • All necessary packages are being fetched from the PPA, preconfigured, unpacked, installed and set up (e.g. postgresql-9.0, postgresql-common, postgresql-client-9.0,...)
  • If not already done a user "postgres" is created and assigned to the group "ssl-cert"
  • Postgres dictionaries for english are installed
  • A database cluster is created. A cluster in Potgres terminology is a storage area in the file system where a collection of databases that is managed by a single instance of a running database server resides.
  • The configuration location is set to /etc/postgresql/9.0/main
  • The data location is /var/lib/postgresql/9.0/main
  • The Postgresql configuration files are stored to /etc/postgresql/9.0/main/postgres.conf, /etc/postgresql/9.0/main/pg_hba.conf and /etc/postgresql/9.0/main/pg_ident.conf
  • The standard port is configured to 5432
Postgresql will be configured to listen to the standard Port 5432 and the server will be automatically started after the installation process.

Step 2b (optional): Install pgAdmin III


pgAdmin III is the de facto standard tool for the administration of you Postgres server and databases. As Martin also provided the latest packages for this, you can easily install it with:

sudo apt-get install pgadmin3

Step 3: Test your installation


Before you test the installation you should set up a new user for the Postgresql server. Although a standard user "postgres" exist, he shouldn't be used for operational work for security reasons. To create a new user, enter

sudo -u postgres createuser --superuser --pwprompt joerg

This runs the command createuser under the user context of the "postgres" user and creates a new user with the name joerg. The new user will be a superuser (--superuser argument) and a prompt for the password of the new user will be issued.

Now you can start testing the server. Just open pgAdmin III and log in with your newly created user.

Kommentare

Beliebte Posts aus diesem Blog

CQRS - Command Query Responsibility Segregation

A lot of information systems have been built with a data manipulation focus in mind. Often CRUD (create, read, update delete) operations built on top of a predefined relational data model are the first functionalities that are implemented and lay out as a foundation for the rest of an application. This is mainly because when we think about information systems we have a mental model of some record structure where we can create new records, read records, update existing records, and delete records. This had been learned throughout the last decade of data centric and transaction oriented IT systems. This approach often leads to shortcomings when it comes to query and analyze the system's data. Classical layered architecture This is where CQRS comes into the game. CQRS stands for Command Query Responsibility Segregation and has been first described by Greg Young and later on by Martin Fowler. This architectural pattern calls for dividing the software architecture into two parts...

Create a Bearer token in Scala

Bearer tokens are a standard which is used in OAuth 2.0 . Although there have been discussions if the security mechanisms are significantly weaker than the use of using signatures as many implementations of OAuth 1.0 did (see http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-00 ), bearer tokens are part of the OAuth 2.0 specification and therefore widely adopted in nearly all implementations. The syntax of Bearer tokens is specified in RFC6750 ( http://http://tools.ietf.org/html/rfc6750 ) This is a lean utils object to create specification compliant Bearers in Scala using the java.security.SecureRandom implementation as a randomizer. The standard generate function returns a token of 32 byte length. A second polymorphic functions allows for the generation of a token of individual size. import scala.util._ import java.security.SecureRandom /* * Generates a Bearer Token with the length of 32 characters according to the * specification RFC6750 (http://http://tools.ietf...

Moore's Law and Amdahl's law

Until the mid oft he 2000’s, there was some kind of an unbreakable fact regarding the vertical scalability of computer hardware and therefore the underlying scaling rules for computer software: Moore’s law. Moore’s law states that the number of transistors on integrated circuits doubles approximately every two years. In good old times of single core processors this meant that also the computing power doubled by this effect. This was a safe harbour for gaining performance in software development. The time was with you, you just had to wait and your execution was getting faster without any changes in the software architecture. Moore’s law is still a valid rule of thumb, but times for the software developers and architects have changed. Although the number of transistors is still growing rapidly, this results in more processor cores since the mid of the 2000’s which means a shift of the vertical scaling approach to horizontal scaling. This also means to gain a positive impact from micro...