[saem-devel] [PATCH 11 of 12] [pg_trgm] Ensure we don't attempt to reinstall extension

saem-devel at lists.cubicweb.org saem-devel at lists.cubicweb.org
Wed Jan 25 13:23:30 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1485274300 -3600
#      Tue Jan 24 17:11:40 2017 +0100
# Node ID 84c910ef62dfd7effede0c957aa00a1e25a0472a
# Parent  7baaa09b7e93291b623b36132421cfe4e70a1004
[pg_trgm] Ensure we don't attempt to reinstall extension

e.g. if it's installed on template1.

diff --git a/cubicweb_saem_ref/pg_trgm.py b/cubicweb_saem_ref/pg_trgm.py
--- a/cubicweb_saem_ref/pg_trgm.py
+++ b/cubicweb_saem_ref/pg_trgm.py
@@ -45,7 +45,7 @@ def sql_init_fti(self):
     """
     schema = old_sql_init_fti(self)
     schema += ''';
-CREATE EXTENSION  pg_trgm;
+CREATE EXTENSION IF NOT EXISTS pg_trgm;
 CREATE TABLE words (
   etype VARCHAR(64) NOT NULL,
   word VARCHAR(100) NOT NULL,


More information about the saem-devel mailing list