changeset 57:f4d5c2c70f98

Suggestion by Karsten Hilbert: CREATE EXTENSION IF NOT EXISTS pg_trgm
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Sep 2018 08:56:42 +0200
parents 4f66bc893fc3
children 0ff0ad51181d
files PostgreSQL/Plugins/PostgreSQLIndex.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Mon Sep 03 16:23:20 2018 +0200
+++ b/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Tue Sep 04 08:56:42 2018 +0200
@@ -143,10 +143,10 @@
         {
           // We've observed 9 minutes on DB with 100000 studies
           LOG(WARNING) << "Trying to enable trigram matching on the PostgreSQL database "
-                    << "to speed up wildcard searches. This may take several minutes";
+                       << "to speed up wildcard searches. This may take several minutes";
 
           db->Execute(
-            "CREATE EXTENSION pg_trgm; "
+            "CREATE EXTENSION IF NOT EXISTS pg_trgm; "
             "CREATE INDEX DicomIdentifiersIndexValues2 ON DicomIdentifiers USING gin(value gin_trgm_ops);");
 
           SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_HasTrigramIndex, 1);