PostgreSQL configuration for VHFFS

VHFFS needs a PostgreSQL database to store its data. We urge you to learn how to use PostgreSQL, because you are going to use it a lot along with VHFFS.

Install PostgreSQL
# apt-get install postgresql
VHFFS user
# su - postgres -c "createuser -P vhffs"
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
VHFFS database
su - postgres -c "createdb -O vhffs vhffs"

This is absolutely necessary that the database is using the UTF-8 encoding, else nothing is going to work properly. Please check that the created database is using the UTF-8 encoding by doing:

root@vhffs:~# su - postgres
postgres@vhffs:~$ psql
postgres=# \l
                                List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
[...]
 vhffs     | vhffs    | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
(4 rows)

If not, you have to create a new PostgreSQL cluster with the UTF-8 encoding. If the VHFFS database was the only database of the previous cluster not using UTF8, you can of course destroy the cluster.

Having several PostgreSQL clusters running will change slightly the psql command lines along this guide, but we consider that if you need several clusters that you know what you are doing and know what you need to change.

Configure the file /etc/postgresql/8.4/main/pg_hba.conf to allow the vhffs user to access the vhffs database. By default localhost is allowed to connect to all databases using a password auth.

Then, initialize the database:

~/vhffs-4.5# psql vhffs vhffs -h localhost
Password for user vhffs: 
psql (9.1.14)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

vhffs=> \i vhffs-backend/src/pgsql/initdb.sql

Don't be dumb! This is initdb.sql, NOT initdb.sql.in, this is not a typo, initdb.sql.in is processed by autotools to create initdb.sql which contains autogenerated stuff like the minimal uid or gid number. If you don't have initdb.sql then just run the ./configure script.

doc/installationguide/basic-postgresql.txt · Last modified: 2014/12/13 16:40 by gradator
Recent changes RSS feed Creative Commons License Donate Minima Template by Wikidesign Driven by DokuWiki