summaryrefslogtreecommitdiff
path: root/docs/manual/smsd/pgsql.rst
diff options
context:
space:
mode:
authorMichal Čihař <nijel@debian.org>2017-10-18 10:36:37 +0200
committerMichal Čihař <nijel@debian.org>2017-10-18 10:36:37 +0200
commitf615ee56e6d4f63c6d454068579d5fc158237067 (patch)
treec388746fbd08c052c58aa732b4193f1149880fa5 /docs/manual/smsd/pgsql.rst
Import gammu_1.38.5.orig.tar.xz
[dgit import orig gammu_1.38.5.orig.tar.xz]
Diffstat (limited to 'docs/manual/smsd/pgsql.rst')
-rw-r--r--docs/manual/smsd/pgsql.rst58
1 files changed, 58 insertions, 0 deletions
diff --git a/docs/manual/smsd/pgsql.rst b/docs/manual/smsd/pgsql.rst
new file mode 100644
index 0000000..eb55b62
--- /dev/null
+++ b/docs/manual/smsd/pgsql.rst
@@ -0,0 +1,58 @@
+.. _gammu-smsd-pgsql:
+
+PostgreSQL Backend
+==================
+
+Description
+-----------
+
+PGSQL backend stores all data in a `PostgreSQL`_ database server, which
+parameters are defined by configuration (see :ref:`gammu-smsdrc` for description of
+configuration options).
+
+For tables description see :ref:`gammu-smsd-tables`.
+
+This backend is based on :ref:`gammu-smsd-sql`.
+
+.. _PostgreSQL: https://www.postgresql.org/
+
+Configuration
+-------------
+
+Before running :ref:`gammu-smsd` you need to create necessary tables in the
+database, which is described below.
+
+The configuration file then can look like:
+
+.. code-block:: ini
+
+ [smsd]
+ service = sql
+ driver = native_pgsql
+ host = localhost
+
+.. seealso:: :ref:`gammu-smsdrc`
+
+.. _pgsql-create:
+
+Creating tables for PostgreSQL
+------------------------------
+
+SQL script for creating tables in PostgreSQL database:
+
+.. literalinclude:: ../../sql/pgsql.sql
+ :language: sql
+
+.. note::
+
+ You can find the script in :file:`docs/sql/pgsql.sql` as well.
+
+Upgrading tables
+----------------
+
+The easiest way to upgrade database structure is to backup old one and start
+with creating new one based on example above.
+
+For upgrading existing database, you can use changes described in
+:ref:`smsd-tables-history` and then manually update ``Version`` field in
+``gammu`` table.