]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - README.md
Modified Readme
[xonotic/xonstatdb.git] / README.md
1 This is the source for **xonstatdb**, the [Xonotic][xonotic] [Statistics database][xonstat].
2 All code herein is intended for the PostgreSQL database management server.
3
4 ----
5
6 To build, first create the user that will own all of the objects in the database.
7 You must run this as an administrator user in your cluster.
8 See your operating system's guidelines for how this is set up on your system.
9
10     create user xonstat with password 'xonstat';
11
12    *Note: please change this password*
13
14 Or from the commandline:
15
16     # su - postgres  (as root)
17     postgres$ createuser -P xonstat  (this will prompt you for the users password)
18
19 Next, create the database itself:
20
21     $ psql
22     postgres=#
23
24     CREATE DATABASE xonstatdb
25       WITH ENCODING='UTF8'
26         OWNER=xonstat
27         CONNECTION LIMIT=-1;
28
29     postgres=# \q
30
31 Next, as your regular system user, log into the newly created database
32 using the user account you just created.
33 Do this from the root directory of your project checkout.
34
35     $ psql -U xonstat xonstatdb
36
37 You might need to force postgres to not use ident, if you get an error
38 like *Peer authentication failed for user "xonstat"*:
39
40     $ psql -h localhost -U xonstat xonstatdb
41
42 Create the schema in which all of the xonstat tables will reside:
43
44     xonstatdb=>
45     
46     CREATE SCHEMA xonstat
47         AUTHORIZATION xonstat;
48
49 Create the pgplsql language, if it doesn't exist:
50
51     CREATE LANGUAGE plpgsql;
52
53 Now load the initial tables:
54
55     \i build/build_full.sql
56
57    *Note: You will see a lot of NOTICE messages. This is normal.*
58
59 And that's it!
60
61 [xonotic]: http://www.xonotic.org/
62 [xonstat]: http://stats.xonotic.org/
63
64 ----
65
66 Project is licensed GPLv3.