Wiki source code of PostgreSQL Installation

Version 5.1 by Vincent Massol on 2011/12/15

Show last authors
1 Follow these instuctions:
2
3 * Download and install PostgreSQL (http://www.postgresql.org/)
4 * Download appropriate [[Postgres JDBC driver>>http://jdbc.postgresql.org/download.html]] (or directly from the [[Maven Central Repository>>http://repo1.maven.org/maven2/postgresql/postgresql/]] and copy the JAR into your container's common lib directory or in the XWiki webapp (in ##WEB-INF/lib##)
5 * Start PostgreSQL
6 * Create the ##xwiki## user (pick any password you want), and the ##xwiki## database:(((
7
8 {{code language="none"}}
9 # psql -U <replace_with_your_admin_user_eg_postgres>;
10
11 // 1. create a database
12 CREATE DATABASE xwiki
13 WITH OWNER = <replace_with_your_admin_user_eg_postgres>
14 ENCODING = 'UNICODE'
15 TABLESPACE = pg_default;
16
17 // Verify available databases
18 \l
19
20 // connect to xwiki
21 \connect xwiki
22
23 // 2. create a user xwiki
24 CREATE USER xwiki PASSWORD 'xwiki' VALID UNTIL 'infinity';
25
26 // 3. grant access to the database for the group xwiki
27 GRANT ALL ON SCHEMA public TO xwiki;
28 {{/code}}
29
30 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):
31
32 {{code}}
33 # createuser xwiki -S -D -R -P -Upostgres
34 ## enter password, ie: 'xwiki'
35 # createdb xwiki -Eunicode -Oxwiki -Upostgres
36 {{/code}}
37 )))
38 * Tell XWiki to use Oracle. To do this, edit the ##WEB-INF/hibernate.cfg.xml## file where you have expanded the XWiki WAR file and uncomment the PostgreSQL part. Make sure to review the ##connection.url## property. For example a typical value would be:(((
39 {{code}}
40 <property name="connection.url">jdbc:postgresql://localhost:5432/xwiki</property>
41 {{/code}}
42 )))

Get Connected