PostgreSQL Installation

Follow these instuctions:

# psql -U replace_with_your_admin_user_eg_pgsql template1;
// Input password
// Create database

// 1. create a database
CREATE DATABASE xwiki
WITH OWNER = replace_with_your_admin_user_eg_pgsql
ENCODING = 'UNICODE'
TABLESPACE = pg_default;

// connect to xwiki
connect xwiki

// 2. create a user xwiki
CREATE USER xwiki PASSWORD 'xwiki' VALID UNTIL 'infinity';

// 3. create a group xwiki and add the xwiki to the group
CREATE GROUP xwiki;
ALTER GROUP xwiki ADD USER xwiki;

// 4. grant access to the database for the group xwiki
GRANT ALL ON SCHEMA public TO xwiki;

another way, if you have 'createuser' and 'createdb' programs in your $PATH and 'postgres' is admin user for postgresql (this is by default in postgresql installation on linux):

# createuser xwiki -S -D -R -P -Upostgres
## enter password, ie: 'xwiki'
# createdb xwiki -Eunicode -Oxwiki -Upostgres

  • Tell XWiki to use PostgreSQL. To do this, edit the WEB-INF/hibernate.cfg.xml file where you have expanded the XWiki WAR file. Replace the matching properties with the following ones (modify the hostname and password accordingly):
<property name="connection.url">jdbc:postgresql://localhost:5432/xwiki</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">your password</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>

<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>

Version 1.24 last modified by VincentMassol on 08/01/2008 at 16:51

Comments 6

alartin | 06.03.2007 at 07:00 AM
Note: If you get xar file import errors(Preferece and Rights are not imported correctly) when using PostgreSQL, it may cause by size limitation of xwd_class_xml column of xwikidoc table. Just change the varchar(20000) to a varchar(200000) and reintall it. In the hibernate mapping file(xwiki.hbm.xml), string will be mapped to varchar, or you can change it to text by hand.

BenWalding | 05.04.2007 at 01:27 PM
This looks to be fixed in 1.0b6

BenWalding | 05.04.2007 at 01:52 PM
I lied; I read the def for the wrong column.

You need to do the table changed as Xin Wu said - alter table xwikidoc alter column xwd_class_xml type varchar(200000);


JohnSchwitz | 17.04.2007 at 10:55 PM
For PostgreSQL on Windows the default port 5432 is needed on the url.

jdbc:postgresql://localhost:5432/yourDBName


muzi | 07.06.2007 at 08:46 AM
I had a modify of this page, since I thought adding UNICODE support and privileges to this configuration would be useful. also group.

BjornarLibaek | 21.08.2007 at 10:40 AM
I've now installed xwiki M4 on both debian stable and ubuntu feisty, using apache2 + tomcat5.5 + postgresql7.4 + libpg-java. On both installs, the tomcat logs displayed a java stacktrace containing the message "Could not create a DBCP pool". I didn't find the reason, but I found that copying the file /usr/share/java/postgresql-jdbc3-8.2.jar (from the libpg-java package) into the xwiki/WEB_INF/lib/ directory solved the problem.

Attachments 0

No attachments for this document

Creator: VincentMassol on 2007/01/30 11:14
This wiki is licensed under a Creative Commons license
1.3.2.9174