mod_storage_sql: Improve check for old table index on PostgreSQL
The "pg_indexes" view is much simpler to inspect than "pg_class"
--- a/plugins/mod_storage_sql.lua Fri Jun 16 13:03:34 2023 +0200
+++ b/plugins/mod_storage_sql.lua Fri Jun 16 23:57:15 2023 +0200
@@ -854,7 +854,7 @@
indices[row[1]] = true;
end
elseif params.driver == "PostgreSQL" then
- for row in engine:select [[SELECT "relname" FROM "pg_class" WHERE "relname"='prosody_index';]] do
+ for row in engine:select [[SELECT "relname" FROM "pg_indexes" WHERE "tablename"='prosody' AND "indexname"='prosody_index';]] do
indices[row[1]] = true;
end
end