diff --git a/src/Storage/IntColumnHandler.php b/src/Storage/IntColumnHandler.php
index 75dcb53..a1038ef 100644
--- a/src/Storage/IntColumnHandler.php
+++ b/src/Storage/IntColumnHandler.php
@@ -94,6 +94,8 @@ abstract class IntColumnHandler implements IntColumnHandlerInterface {
         $schema->addField($table, $column_int, $spec);
         $schema->addIndex($table, $column_int, $index_fields, $full_spec);
       }
+      $column = $this->connection->escapeField($column);
+      $column_int = $this->connection->escapeField($column_int);
       // This is the heart of this function: before an UPDATE/INSERT, set the
       // value of the integer column to the integer value of the string column.
       $body[] = $this->createBody($column_int, $column);
@@ -102,10 +104,11 @@ abstract class IntColumnHandler implements IntColumnHandlerInterface {
       $body = implode(', ', $body);
       $prefixed_name = $this->connection->prefixTables('{' . $table . '}');
       foreach (['update', 'insert'] as $op) {
-        $trigger = $prefixed_name . '_der_' . $op;
+        $trigger = trim($prefixed_name, '"') . '_der_' . $op;
         if (strlen($trigger) > 64) {
           $trigger = substr($trigger, 0, 56) . substr(hash('sha256', $trigger), 0, 8);
         }
+        $trigger = $this->connection->escapeField($trigger);
         $this->connection->query("DROP TRIGGER IF EXISTS $trigger");
         if ($body) {
           $this->createTrigger($trigger, $op, $prefixed_name, $body);
diff --git a/src/Storage/IntColumnHandlerPostgreSQL.php b/src/Storage/IntColumnHandlerPostgreSQL.php
index 18b5f1e..7966774 100644
--- a/src/Storage/IntColumnHandlerPostgreSQL.php
+++ b/src/Storage/IntColumnHandlerPostgreSQL.php
@@ -100,6 +100,7 @@ class IntColumnHandlerPostgreSQL implements IntColumnHandlerInterface {
   protected function createTrigger($table, $column, $column_int) {
     $function_name = $this->getFunctionName($table, $column_int);
     $prefixed_table = $this->getPrefixedTable($table);
+    $column_int = $this->connection->escapeField($column_int);
     // It is much easier to just drop and recreate than figuring it out whether
     // it exists.
     $this->connection->query("DROP TRIGGER IF EXISTS $column_int ON $prefixed_table");
@@ -124,7 +125,7 @@ class IntColumnHandlerPostgreSQL implements IntColumnHandlerInterface {
    *   The plpgsql function name.
    */
   protected function getFunctionName($table, $column_int) {
-    return implode('_', [$this->getPrefixedTable($table), $column_int]);
+    return $this->connection->escapeField(implode('_', [$this->getPrefixedTable($table), $column_int]));
   }
 
   /**
diff --git a/tests/src/Functional/DynamicEntityReferenceBaseTest.php b/tests/src/Functional/DynamicEntityReferenceBaseTest.php
index b8d63e6..f4e669d 100644
--- a/tests/src/Functional/DynamicEntityReferenceBaseTest.php
+++ b/tests/src/Functional/DynamicEntityReferenceBaseTest.php
@@ -239,7 +239,7 @@ class DynamicEntityReferenceBaseTest extends BrowserTestBase {
       'selection_handler' => $settings['entity_test']['handler'],
       'selection_settings_key' => $selection_settings_key,
     ])->toString();
-    $this->assertContains($input->getAttribute('data-autocomplete-path'), $expected_autocomplete_path);
+    $this->assertStringContainsString($input->getAttribute('data-autocomplete-path'), $expected_autocomplete_path);
 
     // Add some extra dynamic entity reference fields.
     $this->getSession()->getPage()->findButton('Add another item')->click();
diff --git a/tests/src/Functional/DynamicEntityReferenceTest.php b/tests/src/Functional/DynamicEntityReferenceTest.php
index 9ed8094..f78ea24 100644
--- a/tests/src/Functional/DynamicEntityReferenceTest.php
+++ b/tests/src/Functional/DynamicEntityReferenceTest.php
@@ -250,7 +250,7 @@ class DynamicEntityReferenceTest extends BrowserTestBase {
       'selection_handler' => $settings['entity_test_computed_field']['handler'],
       'selection_settings_key' => $selection_settings_key,
     ])->toString();
-    $this->assertContains($input->getAttribute('data-autocomplete-path'), $expected_autocomplete_path);
+    $this->assertStringContainsString($input->getAttribute('data-autocomplete-path'), $expected_autocomplete_path);
 
     // Add some extra dynamic entity reference fields.
     $this->getSession()->getPage()->findButton('Add another item')->click();
@@ -298,7 +298,7 @@ class DynamicEntityReferenceTest extends BrowserTestBase {
         'selection_handler' => $settings[$expected_entity_type]['handler'],
         'selection_settings_key' => $selection_settings_key,
       ])->toString();
-      $this->assertContains($input->getAttribute('data-autocomplete-path'), $expected_autocomplete_path);
+      $this->assertStringContainsString($input->getAttribute('data-autocomplete-path'), $expected_autocomplete_path);
     }
 
     $edit = [
