Skip to content
Commits on Source (3)
orthanc-postgresql (2.2-2) unstable; urgency=medium
* Ignore loading of pg_trgm extension if insufficient privileges. Closes: #906771
-- Sebastien Jodogne <s.jodogne@gmail.com> Mon, 03 Sep 2018 16:59:26 +0200
orthanc-postgresql (2.2-1) unstable; urgency=medium
* New upstream version
......
......@@ -13,7 +13,7 @@ Build-Depends: cmake,
postgresql-server-dev-all,
unzip,
uuid-dev
Standards-Version: 4.1.5
Standards-Version: 4.2.1
Vcs-Browser: https://salsa.debian.org/med-team/orthanc-postgresql
Vcs-Git: https://salsa.debian.org/med-team/orthanc-postgresql.git
Homepage: https://www.orthanc-server.com/static.php?page=postgresql
......
Description: Fix uncaught exception preventing db initialization (related to pg_trgm)
Author: Sebastien Jodogne <s.jodogne@gmail.com>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: OrthancPostgreSQL-2.2/PostgreSQL/Plugins/PostgreSQLIndex.cpp
===================================================================
--- OrthancPostgreSQL-2.2.orig/PostgreSQL/Plugins/PostgreSQLIndex.cpp
+++ OrthancPostgreSQL-2.2/PostgreSQL/Plugins/PostgreSQLIndex.cpp
@@ -113,6 +113,18 @@ namespace OrthancDatabases
SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision);
}
+ if (revision != 1)
+ {
+ LOG(ERROR) << "PostgreSQL plugin is incompatible with database schema revision: " << revision;
+ throw Orthanc::OrthancException(Orthanc::ErrorCode_Database);
+ }
+
+ t.Commit();
+ }
+
+ {
+ PostgreSQLTransaction t(*db);
+
int hasTrigram = 0;
if (!LookupGlobalIntegerProperty(hasTrigram, *db, t, Orthanc::GlobalProperty_HasTrigramIndex) ||
hasTrigram != 1)
@@ -139,6 +151,8 @@ namespace OrthancDatabases
SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_HasTrigramIndex, 1);
LOG(WARNING) << "Trigram index has been created";
+
+ t.Commit();
}
catch (Orthanc::OrthancException&)
{
@@ -148,14 +162,6 @@ namespace OrthancDatabases
<< "PostgreSQL server, e.g. on Debian: sudo apt install postgresql-contrib";
}
}
-
- if (revision != 1)
- {
- LOG(ERROR) << "PostgreSQL plugin is incompatible with database schema revision: " << revision;
- throw Orthanc::OrthancException(Orthanc::ErrorCode_Database);
- }
-
- t.Commit();
}
return db.release();
find-orthanc-dev
shlibs
pg_trgm