[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: orthanc-postgresql



On Fri, Mar 06, 2015 at 07:44:41AM +0100, Sébastien Jodogne wrote:

> Another point of attention is the following: Orthanc-PG
> does not necessarily requires PG to be running on the
> localhost (the PG server could be elsewhere).

Aaah, true enough, there you said it all: Not even the
presence of an orthanc-PG pacakge on a given machine means
that the user wants (or needs) to run PG on that machine.

There is no way to sensibly enforce

	make sure PG is started before Orthanc if and only if
	Orthanc is configured to connnect to PG _and_ connect to
	a _local_ PG database

The only way to usefully communicate that state is ...

> If Orthanc is configured for PG but PG is not started,
> Orthanc will stop, will *not* fallback to sqlite [, ...]

... and will loudly and clearly complain:

	you have configured Orthanc to connect to PG with
	$PG_CONN_STRING but I cannot connect with those
	parameters, here is what libpq had to say:
	$LIBPQ_ERROR_MESSAGE (if any)

So, all in all the only useful purpose an orthanc-PG package
might serve is to Depends: on postgresql-*client* thereby
ensuring libpq is installed :-)  thereby freeing the
orthanc(-core) package from that Depends:.

There could be another use: orthanc-pg could provide a
working PG plugin configuration to orthanc(-core) -- which
then only needs setting of connection parameters -- but that
would require you to first make Orthanc read a configuration
directory on startup (because -pg may not modify -core's
config file):

	/etc/orthanc/conf.d/				(from -core)
	/etc/orthanc/conf.d/orthanc.conf	(from -core)
	/etc/orthanc/conf.d/sqlite.conf		(from -sqlite or from -core)
	/etc/orthanc/conf.d/pg.conf			(from -pg)

An alternative would be to invent an inclusion mechanism for
json such that orthanc.conf can say

	\include_if_exists(sqlite.conf)
	\include_if_exists(pg.conf)

or some such.

HOWEVER, given that postgresql-client really isn't that big:

	Installed-Size: 74			(kilobytes)
	Size: 51988					(bytes)
	Installed-Size: 73
	Size: 51714
	Installed-Size: 65
	Size: 42506

you might just do away with the whole gamut and have
orthanc(-core) just install everything (core and PG plugin)
and also Depends: on sqlite _and_ postgresql-client. It would
then provide a default configuration for sqlite and a
correct-but-inactive configuration for the PG plugin.

That is probably what I would suggest at this point.

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


Reply to: