# HG changeset patch # User Sebastien Jodogne # Date 1536044202 -7200 # Node ID f4d5c2c70f98a5cf3e77809a04a217191f1feea2 # Parent 4f66bc893fc37937f65b8453354308757adb9692 Suggestion by Karsten Hilbert: CREATE EXTENSION IF NOT EXISTS pg_trgm diff -r 4f66bc893fc3 -r f4d5c2c70f98 PostgreSQL/Plugins/PostgreSQLIndex.cpp --- 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);