Skip to content

EspoCRM – Open Source CRM Application

fix postgresql index

Yuri Kuznetsovd73a97373d75
diff --git a/application/Espo/Core/Utils/Database/Dbal/Platforms/PostgreSQLSchemaManager.php b/application/Espo/Core/Utils/Database/Dbal/Platforms/PostgreSQLSchemaManager.php
index 454635a3bc..cc797976bc 100644
--- a/application/Espo/Core/Utils/Database/Dbal/Platforms/PostgreSQLSchemaManager.php
+++ b/application/Espo/Core/Utils/Database/Dbal/Platforms/PostgreSQLSchemaManager.php
@@ -44,6 +44,10 @@ class PostgreSQLSchemaManager extends BasePostgreSQLSchemaManager
foreach ($tableIndexes as $row) {
$key = $row['relname'];
+ if (is_string($tableName) && str_starts_with($tableName, '"') && str_ends_with($tableName, '"')) {
+ $tableName = substr($tableName, 1, -1);
+ }
+
if ($key === "idx_{$tableName}_system_full_text_search") {
$sql = "SELECT indexdef FROM pg_indexes WHERE indexname = '{$key}'";