1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Prepare PostgreSQL
==================

There should already be a system user, likely ``postgres``.

Become root:

.. code-block:: console

    $ su
    <enter root password>

Switch to the ``postgres`` user:

.. code-block:: console

    # su postgres

Create a database user named ``byceps``:

.. code-block:: console

    postgres@host$ createuser --echo --pwprompt byceps

You should be prompted to enter a password. Do that.

In your :doc:`BYCEPS configuration file <byceps-config-file>`, replace
the example password in the value of :confval:`SQLALCHEMY_DATABASE_URI`
with the one you just entered.

Create a schema, also named ``byceps``:

.. code-block:: console

    postgres@host$ createdb --encoding=UTF8 --template=template0 --owner byceps byceps

To run the tests (optional), a dedicated user and database have to be
created:

.. code-block:: console

    postgres@host$ createuser --echo --pwprompt byceps_test
    postgres@host$ createdb --encoding=UTF8 --template=template0 --owner byceps_test byceps_test

Connect to the database:

.. code-block:: console

    $ psql