1<chapter xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 version="5.0"
5 xml:id="module-postgresql">
6
7<title>PostgreSQL</title>
8
9<!-- FIXME: render nicely -->
10
11<!-- FIXME: source can be added automatically -->
12<para><emphasis>Source:</emphasis> <filename>modules/services/databases/postgresql.nix</filename></para>
13
14<para><emphasis>Upstream documentation:</emphasis> <link xlink:href="http://www.postgresql.org/docs/"/></para>
15
16<!-- FIXME: more stuff, like maintainer? -->
17
18<para>PostgreSQL is an advanced, free relational database.<!-- MORE --></para>
19
20<section><title>Configuring</title>
21
22<para>To enable PostgreSQL, add the following to your
23<filename>configuration.nix</filename>:
24
25<programlisting>
26services.postgresql.enable = true;
27services.postgresql.package = pkgs.postgresql94;
28</programlisting>
29
30Note that you are required to specify the desired version of
31PostgreSQL (e.g. <literal>pkgs.postgresql94</literal>). Since
32upgrading your PostgreSQL version requires a database dump and reload
33(see below), NixOS cannot provide a default value for
34<option>services.postgresql.package</option> such as the most recent
35release of PostgreSQL.</para>
36
37<!--
38<para>After running <command>nixos-rebuild</command>, you can verify
39whether PostgreSQL works by running <command>psql</command>:
40
41<screen>
42$ psql
43psql (9.2.9)
44Type "help" for help.
45
46alice=>
47</screen>
48-->
49
50<para>By default, PostgreSQL stores its databases in
51<filename>/var/db/postgresql</filename>. You can override this using
52<option>services.postgresql.dataDir</option>, e.g.
53
54<programlisting>
55services.postgresql.dataDir = "/data/postgresql";
56</programlisting>
57
58</para>
59
60</section>
61
62
63<section><title>Upgrading</title>
64
65<para>FIXME: document dump/upgrade/load cycle.</para>
66
67</section>
68
69
70<section><title>Options</title>
71
72<para>FIXME: auto-generated list of module options.</para>
73
74</section>
75
76
77</chapter>