TikiPostgres

About
Install Tikiwiki with a PostgreSQL database (aka postgres or pgsql).
This small HowTo is the start of my watch work on postgresql tikiwiki compliance. Environment is a GNU/Linux debian with 1.8.1 and with 1.9 versions.-- mose

Table Of Contents


Install & configure postgres


Make sure that the postgres module for php is installed, or things will silently fail later on.

Be sure that your postgres server is configured to accept password accounts :
root# vi /etc/postgresql/pg_hba.conf
...
local   all         all                                             password
host    all         all         127.0.0.1         255.255.255.255   password

Create a db user You may use any other auth scheme, that one is just easy and secure.
root# su - postgres
postgres$ createuser -P tikiwiki
Enter password for new user:
Enter it again:
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
postgres$ createdb -O tikiwiki tikiwiki
CREATE DATABASE
postgres$ exit
root# psql -U tikiwiki tikiwiki
Password:
Welcome to psql 7.4.1, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

tikiwiki=> \q
root#


Install Tikiwiki

Version 1.8.1 tarball

Get the tarball from http://sourceforge.net/project/showfiles.php?group_id=64258&release_id=193747(external link)
mose$ tar xjf tikiwiki-1.8.1.tar.bz2
mose$ cd tikiwiki-1.8.1
mose$ psql -U tikiwiki tikiwiki < db/tiki-1.8-pgsql.sql
Password:

Version 1.9 cvs HEAD

mose$ cvs -z3 -d:ext:mose@cvs.sf.net:/cvsroot/tikiwiki co -d tiki19_psql tikiwiki
mose$ cd tiki19_psql
mose$ psql -U tikiwiki tikiwiki < db/tiki-1.9-pgsql.sql
Password:

Note: the pgsql output can generate some messages and say there were errors. You can ignore the errors saying ERROR: table "bla_bla" does not exist but if there are parsing errors it usually causes that some database tables are not to be created. It means the convertscripts/*.php file didn't worked properly and needs to be fixed to produce right syntax for PostgreSQL and then it must be run again (see below how to do it) to fix the tiki-1.9-pgsql.sql file.

Tikiwiki setup

You don't need to use tiki-install.php web install, the following manual install is enough
mose$ sudo ./setup.sh mose www-data 02777
mose$ vi db/local.php
<?php
$db_tiki     = 'pgsql';
$host_tiki   = 'localhost';
$user_tiki   = 'tikiwiki';
$pass_tiki   = '***';
$dbs_tiki    = 'tikiwiki';
?>

Then go to http://vhost/(external link) or any url you configured in apache for going to tiki, connect as admin/admin, change admin password, and you can now configure tiki as any other tiki.

Regenerating the SQL file for latest features/bug fixes

When there's a change in db/tiki.sql file you can regenerate the tiki-<version>-pgsql.sql file yourself (if it wasn't done by someone else already) using the following commands (example, versions can differ):
cd db/convertscripts/
php mysql3topgsql72.php
mv 1.9.to_pgsql72.sql ../tiki-1.9-pgsql.sql

Do not edit the tiki-1.9-pgsql.sql file manually when it's not really needed ! If you don't backup the file it can be overwritten next time you update your Tiki

Known Issues

Store on disk not on db

As there are problems for handling binaries in tiki with postgres it's better to always choose storage on filesystem for file galleries, image galleries, forum attachments as well as for trackers and wiki.

No possibility to update DB without loose of data (?)

There's still no DB upgrade script written like for MySQL (tiki-1.8to1.9.sql)

Tiki User Tasks

They don't save. Only the following message appears:
Sorry, there was an error while trying to write data into the database


Saving large amounts of text.

This will generate a postgres error because the size of the text generates a btree index on the row which is too large for postgres. The error says something to the extent:
ERROR: index row requires XXXX bytes...

There is a sort of backdoor workaround and that is to modify two indices manually in postgres on the data column and put a where clause to limit the indexing size. Eg. where char_length("data") < 1000.

... gather here more information about specific needs with pgsql use ...



Contributors to this page: skeet0230 , luci4279 points  , rlpowell74 points  and mose4290 points  .
Page last modified on Wednesday 07 September 2005 00:33:59 CEST by skeet0230.

Switch Language

Subscribe to Tiki Newsletters!

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki

Shoutbox

Torsten1785 points , 13:29 CET, Fri 10 Feb. 2012: Next webinar at Thursday, 16. of Feb. 2012 (21:00 UTC) at http://tiki.org/live
ricks9915694 points , 16:36 CET, Thu 19 Jan. 2012: Free webinar, today at 21:00 UTC http://bit.ly/zeH0UE
marclaporte42827 points , 05:17 CET, Tue 17 Jan. 2012: Tiki 8.3 and 6.6 LTS now available: [Link]
ricks9915694 points , 13:34 CET, Tue 20 Dec 2011: Tiki 8.2 & 6.5LTS now available: [Link]
ricks9915694 points , 18:00 CET, Fri 11 Nov. 2011: Tiki 8.1 now available: [Link]