This file is indexed.

/usr/share/doc/orthanc-postgresql/README.Debian is in orthanc-postgresql 2.0-3+b1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
General
=======

Orthanc PostgreSQL is a set of 2 plugins to Orthanc, a lightweight,
RESTful Vendor Neutral Archive for medical imaging. These plugins
override the default SQLite engine of Orthanc with a PostgreSQL
back-end. They bring scalability to Orthanc, making it
enterprise-ready.

Homepage: http://www.orthanc-server.com/static.php?page=postgresql



Configuration
=============

To enable the plugin, you must specify the parameters of your
PostgreSQL database by adapting the configuration file
"/etc/orthanc/postgresql.json". Then, restart the Orthanc service:

	$> sudo systemctl restart orthanc.service



Upgrade
=======

The schema of the Orthanc database evolves across versions. If you use
a PostgreSQL database that was created for an older version of the
schema, Orthanc will fail to start and you will have to manually
upgrade the database.

You can read the status of the Orthanc service in the log:

	$> cat /var/log/orthanc/Orthanc.log

If, after upgrading the orthanc-postgresql package, Orthanc complains
that the database schema must be upgraded, type the following commands
(reconstructing the database may take some time):

	$> sudo systemctl stop orthanc.service
	$> sudo /usr/sbin/Orthanc /etc/orthanc --verbose --upgrade
	$> sudo systemctl start orthanc.service


NOTE: As an alternative to the automated upgrade (e.g. if you face
problems or if you wish to keep the older version of the database),
you can have a look at the instructions for replication in the Orthanc
Book: https://orthanc.chu.ulg.ac.be/book/users/replication.html



Step-by-step tutorial
=====================

(1) Install the database server:

	$> sudo apt-get install postgresql


(2) Create a database account a database to store the
    content of Orthanc:

	$> sudo -u postgres createuser -e orthanc
	$> sudo -u postgres createdb -e -E utf8 -O orthanc orthanc_db


(3) Restrict access to the Orthanc database:

	Edit /etc/postgresql/VERSION/main/pg_hba.conf to contain

		local   orthanc_db     orthanc                                  ident

	somewhere AFTER the lines

		# Database administrative login by Unix domain socket
		local   all             postgres                                ident

	Reload PostgreSQL configuration

		$> sudo systemctl reload postgresql.service


(3) Edit the configuration file "/etc/orthanc/postgresql.json"
    to make Orthanc connect to PostgreSQL:

	"PostgreSQL" : {
		"EnableIndex" : true,
		"EnableStorage": true,
		"ConnectionUri" : "postgresql:///orthanc_db?user=orthanc",
	}

	Make sure to comment out all individual authentication
	parameters such as Host, Port, ...


(4) Restart the Orthanc service and check the logs:

	$> sudo apt-get install postgresql
	$> sudo less /var/log/orthanc/Orthanc.WARNING
	$> sudo less /var/log/postgresql/postgresl-VERSION-main.log



Further notes
=============

Setup

One can use any name for the database, as long as reality and
configuration match.

The database account should be "orthanc" in order to enable intuitive use
of PEER authentication because Orthanc is running as the "orthanc" system
user. If you need to use another database account adjust pg_hba.conf
accordingly or use a user name mapping (see PostgreSQL documentation).


Data integrity

If you intend to set "StoreMD5ForAttachments" to "true" in orthanc.json
you should strongly consider making sure the PostgreSQL cluster is set to
provide on-disk data page checksumming instead. Check with the following
SQL query:

	psql> select * from pg_settings where name = 'data_checksums';

There is no need to make Orthanc calculate MD5 sums when PostgreSQL is
already doing it for on-disk storage.


Data compression

Also, strongly consider to NOT set "StorageCompression" to "true" when
using PostgreSQL because the database will already compress data (TOAST,
EXTENDED storage, pg_largeobject)


Data migration