Wiki source code of PostgreSQL Installation

Version 7.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 JDBC4 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 and the ##xwiki## database:(((
7 * Using the ##psql## tool:(((
8
9 In a shell, start the PostgreSQL interactive terminal:
10
11 {{code language="none"}}
12 psql -U <replace_with_your_admin_user_eg_postgres>;
13 {{/code}}
14
15 Create the ##xwiki## database:
16 {{code language="none"}}
17 CREATE DATABASE xwiki
18 WITH OWNER = <replace_with_your_admin_user_eg_postgres>
19 ENCODING = 'UNICODE'
20 TABLESPACE = pg_default;
21 {{/code}}
22
23 Verify that the ##xwiki## database is listed in the available databases:
24
25 {{code language="none"}}
26 \l
27 {{/code}}
28
29 Connect to the ##xwiki## database:
30
31 {{code language="none"}}
32 \connect xwiki
33 {{/code}}
34
35 Create a ##xwiki## user:
36
37 {{code language="none"}}
38 CREATE USER xwiki PASSWORD 'xwiki' VALID UNTIL 'infinity';
39 {{/code}}
40
41 Verify that the ##xwiki## user is listed in the available users:
42
43 {{code language="none"}}
44 \du
45 {{/code}}
46
47 Gives all permissions to the ##xwiki## user:
48
49 {{code language="none"}}
50 GRANT ALL ON SCHEMA public TO xwiki;
51 {{/code}}
52 )))
53 * Using the ##createuser## and ##createdb## programs:(((
54
55 Make sure that the ##createuser## and ##createdb## programs are in your ##$PATH##. The example below also assumes that the ##postgres## user exists in your setup (this is the default on Linux).
56
57 Create the ##xwiki## user:
58
59 {{code}}
60 createuser xwiki -S -D -R -P -Upostgres
61 {{/code}}
62
63 Create the ##xwiki## database:
64
65 {{code}}
66 createdb xwiki -Eunicode -Oxwiki -Upostgres
67 {{/code}}
68 )))
69 )))
70 * 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:(((
71 {{code}}
72 <property name="connection.url">jdbc:postgresql://localhost:5432/xwiki</property>
73 {{/code}}
74 )))

Get Connected