Wiki source code of PostgreSQL Installation

Version 6.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 // Verify available users
27 \du
28
29 // 3. grant access to the database for the group xwiki
30 GRANT ALL ON SCHEMA public TO xwiki;
31 {{/code}}
32
33 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):
34
35 {{code}}
36 # createuser xwiki -S -D -R -P -Upostgres
37 ## enter password, ie: 'xwiki'
38 # createdb xwiki -Eunicode -Oxwiki -Upostgres
39 {{/code}}
40 )))
41 * 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:(((
42 {{code}}
43 <property name="connection.url">jdbc:postgresql://localhost:5432/xwiki</property>
44 {{/code}}
45 )))

Get Connected