diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc
index 49adbf9..1a1c179 100644
--- a/includes/database/pgsql/schema.inc
+++ b/includes/database/pgsql/schema.inc
@@ -72,7 +72,25 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
     }
     return $this->tableInformation[$key];
   }
-
+  
+  /**
+   * Create names for indexes, primary keys and constraints.
+   *
+   * This prevents using {} around non-table names like indexes and keys.
+   *
+   * This overrides the default prefix to shorten index names to be only 64 characters long.
+   */
+  function prefixNonTable($table) {
+    $args = func_get_args();
+    $info = $this->getPrefixInfo($table);
+    $args[0] = $info['table'];
+    $name = implode('_', $args);
+    while(strlen($name) > 63) {
+      $name = preg_replace('/[a-z0-9]_/', '_', $name);
+    }
+    return $name;
+  }
+  
   /**
    * Fetch the list of CHECK constraints used on a field.
    *
