Software /
code /
prosody
Diff
plugins/mod_storage_sql.lua @ 13155:9a7523ea45cb
mod_storage_sql: Improve check for old table index on PostgreSQL
The "pg_indexes" view is much simpler to inspect than "pg_class"
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 16 Jun 2023 23:57:15 +0200 |
parent | 13154:6cf5c215825d |
child | 13156:019cd1db9bec |
line wrap: on
line diff
--- 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