diff --git a/core/includes/database/pgsql/schema.inc b/core/includes/database/pgsql/schema.inc index 9ed8a26203275b82d2c6c638ba84f5362265a95d..49adbf9077627e33fa354b7521cd642c4db9c8ef 100644 --- a/core/includes/database/pgsql/schema.inc +++ b/core/includes/database/pgsql/schema.inc @@ -328,9 +328,9 @@ function renameTable($table, $new_name) { // rename them when renaming the table. $indexes = $this->connection->query('SELECT indexname FROM pg_indexes WHERE schemaname = :schema AND tablename = :table', array(':schema' => $old_schema, ':table' => $old_table_name)); foreach ($indexes as $index) { - if (preg_match('/^' . preg_quote($old_full_name) . '_(.*)_idx$/', $index->indexname, $matches)) { + if (preg_match('/^' . preg_quote($old_full_name) . '_(.*)$/', $index->indexname, $matches)) { $index_name = $matches[1]; - $this->connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name . '_idx'); + $this->connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name); } }