# HG changeset patch # User Kim Alvefur # Date 1686952635 -7200 # Node ID 9a7523ea45cbef5b7e81e5350fb840aba1eeb710 # Parent 6cf5c215825de6bf4bb47b0c2fc638ab2ceb7f54 mod_storage_sql: Improve check for old table index on PostgreSQL The "pg_indexes" view is much simpler to inspect than "pg_class" diff -r 6cf5c215825d -r 9a7523ea45cb plugins/mod_storage_sql.lua --- 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