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

Device-Weiche in PHP

Anforderungen für Device-Weichen Je mehr Anforderungen an die Unterstützung von unterschiedlichen Devices kommen, desto öfter steht man vor der Frage, wie die verschiedenen Ausgabegeräte zwecks unterschiedliche Behandlung auf einer Seite unterschieden werden können, um dann z.B. jeweils eine Weiterleitung auf unterschiedliche Zielseiten vorzunehmen welche das entsprechende Device unterstützen, also eine sogenannte Device-Weiche oder Browser-Weiche. Klassische Use Cases sind hier: Je nach Device die "klassische" Website oder die mobile Site anzeigen Eine Landing Page erstellen, welche unterschiedliche mobile Devices zu unterschiedlichen Zielseiten (z.B. Subdomains) verzweigt Eine Redirect-Verteilerseite, welche mobile Devices in die verschiedenen Stores für einen mobile App Download weiterleitet Das letztgenannte Beispiel möchte ich hier einmal exemplarisch demonstrieren. Man stelle sich folgendes Szenario vor: Demo-Szenario Im Rahmen einer Web-Anwendung ...

Add an existing Grails project to Bitbucket using Git

I just started using Bitbucket as a new service to host masters of my source code repositories using Git. If you develop with Grails (like I also do more often) and ever asked yourself how to create a Git repository out of an existing project, here is the solution. Prerequisits Of course you need to have Git installt locally on your machine. If you haven't here are instructions on how to do it (if your a Mac user, I find this Mac OS X installer very useful). Of course you also need an account for bitbucket.org . It's free and easy to set up. In addition to your account you need to create an empty repository. Follow the guidance on the Bitbucket site, it's quite easy. Prepare your grails project As you do not want to store all your files in the repository, you need to create a so called .gitignore file. To do so, you can use a grails command: > grails integrate-with --git Afterwards, the .gitignore file has been created. If you are using the Grovy & Gr...

Creating load tests with Gatling instead of JMeter

I just came around a tool called Gatling (http://gatling-tool.org/) to create load tests for web applications. I used to use JMeter for a long time, but JMeter has weaknesses that Gatling doesn‘t have. JMeter uses a synchronous request approach. That means for every request JMeter generates, an internal thread is raised and therefore blocked until a response is being received or a timeout happens. This results in resource blocking on the load injector. The maximum number of threads is limited within a JVM - dependent on the underlying infrastructure -  and even if you are able to run a lot of parallel threads this will result in a high CPU and memory utilization. Although performance tweaking and scaling out to distributed testing might help in such a case, it makes testing more complex and error-prone. This behavior can result in distorted metrics. Think about a typical breakpoint load test. You want to determine, which is the maximum number of requests per second your tested ...