Installing Postgres for PHP
From MoodleDocs
Installing Moodle on Ubuntu with PostgreSQL
Introduction
This section explains how to install Moodle with PostgreSQL on Ubuntu.
Install PosgreSQL
All the documentation has been written here: Install Postgres on Ubuntu
In order to manage Postgres on Ubuntu, you can install pgadmin:
sudo aptitude install pgadmin3
then run it:
pgadmin3
Select File menu, Add Server... Enter the parameters you created during your postgres installation. Then you should be able to manage your Moodle database.
Setting up your database during Moodle installation
During the Moodle installation process, on the Database setup page enter:
Database: postgres7 // Note: it will also work if you installed postgres 8.XX Host: host='localhost' port=5432 dbname='moodle' user='moodleuser' password='password' //change the parameters Tables prefix: mdl_ Leave the other field blank
Continue the installation, all should work without problem.