Verified Commit c9412349 authored by Dave Long's avatar Dave Long
Browse files

Issue #3349973 by Akram Khan, Arantxio, m.stenta, daffie, poker10, hestenet,...

Issue #3349973 by Akram Khan, Arantxio, m.stenta, daffie, poker10, hestenet, quietone, wotnak: Automatically install pg_trgm extension on PostgreSQL 13+
parent ad0ffae2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -248,6 +248,13 @@ protected function checkStandardConformingStringsSuccess() {
  public function checkExtensions() {
    $connection = Database::getConnection();
    try {
      // Enable pg_trgm for PostgreSQL 13 or higher.
      // @todo Remove this if-statement in D11 when the minimum required version
      // for PostgreSQL becomes 13 or higher. https://www.drupal.org/i/3357409
      if (version_compare($connection->version(), '13.0', '>=')) {
        $connection->query('CREATE EXTENSION IF NOT EXISTS pg_trgm');
      }

      if ($connection->schema()->extensionExists('pg_trgm')) {
        $this->pass(t('PostgreSQL has the pg_trgm extension enabled.'));
      }