annotate Sphinx/source/plugins/postgresql.rst @ 129:61050d813d74

build wsi
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Jan 2018 11:06:35 +0100
parents f2abbac22d5c
children 365427cebb64
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
25fa874803ab plugins inside book
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _postgresql:
25fa874803ab plugins inside book
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
25fa874803ab plugins inside book
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
25fa874803ab plugins inside book
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 PostgreSQL plugins
25fa874803ab plugins inside book
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 ==================
25fa874803ab plugins inside book
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
7 .. contents::
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
8
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
9 The Orthanc project provides two **official** plugins to replace the
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
10 default storage area (on the filesystem) and the default SQLite index
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
11 by a PostgreSQL database.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
12
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
13 For general information, check out the `official homepage of the
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
14 plugins <http://www.orthanc-server.com/static.php?page=postgresql>`__.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
15
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
16
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
17
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
18 Compilation
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
19 -----------
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
20
128
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
21 Static linking
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
22 ^^^^^^^^^^^^^^
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
23
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
24 .. highlight:: text
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
25
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
26 The procedure to compile these plugins is similar of that for the
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
27 :ref:`core of Orthanc <compiling>`. The following commands should work
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
28 for every UNIX-like distribution (including GNU/Linux)::
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
29
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
30 $ mkdir Build
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
31 $ cd Build
81
4eea0dc5f071 documenting wsi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 31
diff changeset
32 $ cmake .. -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
33 $ make
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
34
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
35 The compilation will produce 2 shared libraries, each containing one plugin for Orthanc:
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
36
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
37 * ``OrthancPostgreSQLIndex`` replaces the default SQLite index of Orthanc by PostgreSQL.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
38 * ``OrthancPostgreSQLStorage`` makes Orthanc store the DICOM files it receives into PostgreSQL.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
39
128
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
40
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
41 Microsoft Windows and Apple OS X
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
43
28
dc235678897c webviewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
44 Pre-compiled binaries for Microsoft Windows `are also available
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
45 <http://www.orthanc-server.com/browse.php?path=/plugin-postgresql>`__.
30
79b6d3ea92aa dicomweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
46 A package for `Apple's Mac OS X
94
b0a71b880ca0 fix link + remark about disk usage overhead
Alain Mazy <alain@mazy.be>
parents: 81
diff changeset
47 <http://www.osimis.io/en/download.html>`__
128
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
48 is available courtesy of `Osimis <http://osimis.io/>`__.
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
49
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
50
128
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
51 Dynamic linking on Ubuntu 16.04
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
52 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
53
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
54 .. highlight:: text
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
55
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
56 If static linking is not desired, here are build instructions for
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
57 Ubuntu 16.04 (provided build dependencies for the :ref:`core of
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
58 Orthanc <compiling>` have already been installed)::
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
59
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
60 $ sudo apt-get install libpq-dev postgresql-server-dev-all
129
61050d813d74 build wsi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 128
diff changeset
61 $ cmake .. -DCMAKE_BUILD_TYPE=Release \
128
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
62 -DALLOW_DOWNLOADS=ON \
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
63 -DUSE_SYSTEM_GOOGLE_TEST=OFF \
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
64 -DUSE_SYSTEM_ORTHANC_SDK=OFF
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
65 $ make
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
66
f2abbac22d5c postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 118
diff changeset
67
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
68 Usage
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
69 -----
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
70
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
71 .. highlight:: json
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
72
31
93bbfaf0e62c worklist instructions migrated to a specific page, indexing of Osimis Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
73 You of course first have to :ref:`install Orthanc <binaries>`, with a
28
dc235678897c webviewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
74 version above 0.9.1. You then have to **create a database** dedicated
dc235678897c webviewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
75 to Orthanc on some PostgreSQL server. Please refer to the `PostgreSQL
dc235678897c webviewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
76 documentation
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
77 <https://www.postgresql.org/docs/current/static/tutorial-createdb.html>`__.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
78
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
79 Once Orthanc is installed and the database is created, you must add a
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
80 section in the :ref:`configuration file <configuration>` that
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
81 specifies the address of the **PostgreSQL server together with your
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
82 credentials**. You also have to tell Orthanc in which path it can find
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
83 the plugins: This is done by properly modifying the ``Plugins``
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
84 option. You could for instance adapt the following configuration
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
85 file::
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
86
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
87 {
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
88 "Name" : "MyOrthanc",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
89 [...]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
90 "PostgreSQL" : {
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
91 "EnableIndex" : true,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
92 "EnableStorage" : true,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
93 "Host" : "localhost",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
94 "Port" : 5432,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
95 "Database" : "orthanc",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
96 "Username" : "orthanc",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
97 "Password" : "orthanc"
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
98 },
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
99 "Plugins" : [
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
100 "/home/user/OrthancPostgreSQL/Build/libOrthancPostgreSQLIndex.so",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
101 "/home/user/OrthancPostgreSQL/Build/libOrthancPostgreSQLStorage.so"
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
102 ]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
103 }
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
104
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
105 Note that ``EnableIndex`` and ``EnableStorage`` must be explicitly set
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
106 to true, otherwise Orthanc will continue to use its default SQLite
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
107 back-end.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
108
118
a30abf63ccba postgres: reference to forum for space usage
amazy
parents: 94
diff changeset
109 **Remark:** When using the ``Storage`` PostgreSQL plugin, the DICOM files are stored as large objects in the database. This might actually consume more space than the DICOM file itself. We have observed overhead up to 40%. However, it seems this overhead is temporary and comes from Write-Ahead Logging. Check this `discussion <https://groups.google.com/d/msg/orthanc-users/pPzHOpb--iw/QkKZ808gIgAJ>`__ on the Orthanc Users group for more info).
a30abf63ccba postgres: reference to forum for space usage
amazy
parents: 94
diff changeset
110
a30abf63ccba postgres: reference to forum for space usage
amazy
parents: 94
diff changeset
111 Note that a typical usage of the PostgreSQL plugin is to enable only the ``Index`` and continue using the default filesystem storage for DICOM files.
a30abf63ccba postgres: reference to forum for space usage
amazy
parents: 94
diff changeset
112
a30abf63ccba postgres: reference to forum for space usage
amazy
parents: 94
diff changeset
113
94
b0a71b880ca0 fix link + remark about disk usage overhead
Alain Mazy <alain@mazy.be>
parents: 81
diff changeset
114
27
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
115 .. highlight:: text
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
116
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
117 Orthanc must of course be **restarted** after the modification of its
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
118 configuration file. The log will contain an output similar to::
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
119
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
120 $ ./Orthanc Configuration.json
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
121 W0212 16:30:34.576972 11285 main.cpp:632] Orthanc version: 0.8.6
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
122 W0212 16:30:34.577386 11285 OrthancInitialization.cpp:80] Using the configuration from: Configuration.json
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
123 [...]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
124 W0212 16:30:34.598053 11285 main.cpp:379] Registering a plugin from: /home/jodogne/Subversion/OrthancPostgreSQL/Build/libOrthancPostgreSQLIndex.so
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
125 W0212 16:30:34.598470 11285 PluginsManager.cpp:258] Registering plugin 'postgresql-index' (version 1.0)
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
126 W0212 16:30:34.598491 11285 PluginsManager.cpp:148] Using PostgreSQL index
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
127 W0212 16:30:34.608289 11285 main.cpp:379] Registering a plugin from: /home/jodogne/Subversion/OrthancPostgreSQL/Build/libOrthancPostgreSQLStorage.so
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
128 W0212 16:30:34.608916 11285 PluginsManager.cpp:258] Registering plugin 'postgresql-storage' (version 1.0)
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
129 W0212 16:30:34.608947 11285 PluginsManager.cpp:148] Using PostgreSQL storage area
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
130 [...]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
131 W0212 16:30:34.674648 11285 main.cpp:530] Orthanc has started
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
132
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
133
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
134 .. highlight:: json
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
135
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
136 Instead of specifying explicit authentication parameters, you can also
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
137 use the `PostgreSQL connection URIs syntax
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
138 <https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING>`__. For
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
139 instance::
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
140
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
141 {
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
142 "Name" : "MyOrthanc",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
143 [...]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
144 "PostgreSQL" : {
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
145 "EnableIndex" : true,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
146 "EnableStorage" : true,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
147 "ConnectionUri" : "postgresql://username:password@localhost:5432/database"
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
148 },
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
149 "Plugins" : [
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
150 "/home/user/OrthancPostgreSQL/Build/libOrthancPostgreSQLIndex.so",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
151 "/home/user/OrthancPostgreSQL/Build/libOrthancPostgreSQLStorage.so"
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
152 ]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
153 }
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
154
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
155
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
156 **Remark:** The Debian Med project maintains `another useful set of
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
157 instructions
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
158 <https://anonscm.debian.org/viewvc/debian-med/trunk/packages/orthanc-postgresql/trunk/debian/README.Debian?view=markup>`__.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
159
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
160
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
161 Advanced options
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
162 ----------------
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
163
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
164 Several advanced options are available as well to fine-tune the
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
165 configuration of the PostgreSQL plugins. They are documented below.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
166
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
167
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
168 Locking
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
169 ^^^^^^^
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
170
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
171 .. highlight:: json
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
172
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
173 By default, the plugins lock the database (using `PostgreSQL advisory
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
174 locks
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
175 <https://www.postgresql.org/docs/current/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS>`__)
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
176 to prevent other instances of Orthanc from using the same PostgreSQL
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
177 database. If you want several instances of Orthanc to share the same
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
178 database, set the ``Lock`` option to ``false`` in the configuration
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
179 file::
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
180
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
181 {
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
182 "Name" : "MyOrthanc",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
183 [...]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
184 "PostgreSQL" : {
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
185 "EnableIndex" : true,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
186 "EnableStorage" : true,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
187 "Lock" : false,
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
188 "ConnectionUri" : "postgresql://username:password@localhost:5432/database"
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
189 },
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
190 "Plugins" : [
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
191 "/home/user/OrthancPostgreSQL/Build/libOrthancPostgreSQLIndex.so",
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
192 "/home/user/OrthancPostgreSQL/Build/libOrthancPostgreSQLStorage.so"
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
193 ]
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
194 }
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
195
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
196 Obviously, one must be very cautious when sharing the same database
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
197 between instances of Orthanc. In particular, all these instances
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
198 should share the same configuration.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
199
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
200
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
201 Keep-alive
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
202 ^^^^^^^^^^
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
203
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
204 .. highlight:: text
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
205
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
206 After some period of inactivity (users have reported 10 hours), you
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
207 might `experience an error
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
208 <https://bitbucket.org/sjodogne/orthanc/issues/15/postgresql-exceptions-after-time>`__
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
209 such as::
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
210
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
211 E0220 03:20:51.562601 PluginsManager.cpp:163] Exception in database back-end: Error in PostgreSQL: server closed the connection unexpectedly.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
212 This probably means the server terminated abnormally before or while processing the request.
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
213 E0220 06:51:03.924868 PluginsManager.cpp:163] Exception in database back-end: Error in PostgreSQL: no connection to the server
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
214
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
215 This is due to a timeout in the PostgreSQL server. Please make sure to
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
216 `enable keep-alive
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
217 <http://dba.stackexchange.com/questions/97534/is-there-a-timeout-option-for-remote-access-to-postgresql-database>`__
c23f02a64caf postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
218 in the configuration of your PostgreSQL server