summary refs log tree commit diff
path: root/docs/postgres.rst
blob: 5bb45d3ed9f5a31781d7643fd770a46eec045034 (plain) (blame)
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
Using Postgres
--------------

Set up client
=============
We need to have installed the postgres python connector ``psycopg2``. In the
virtual env::

    sudo apt-get install libpq-dev
    pip install psycopg2


Synapse config
==============

Add the following line to your config file::

    database_config: <db_config_file>

Where ``<db_config_file>`` is the file name that points to a yaml file of the
following form::

    name: psycopg2
    args:
        user: <user>
        password: <pass>
        database: <db>
        host: <host>
        cp_min: 5
        cp_max: 10

All key, values in ``args`` are passed to the ``psycopg2.connect(..)``
function, except keys beginning with ``cp_``, which are consumed by the twisted
adbapi connection pool.