diff options
author | Kim Alvefur <zash@zash.se> | 2023-06-16 23:57:15 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-06-16 23:57:15 +0200 |
commit | f70ab44b4c3f4bdf65795b85fc2f98e94feca1fb (patch) | |
tree | c3ccc03e5fa04f580bb91324d9acda15aa40bc75 | |
parent | b2cc309529ce43511af3c7a02922a7451dea7e13 (diff) | |
download | prosody-f70ab44b4c3f4bdf65795b85fc2f98e94feca1fb.tar.gz prosody-f70ab44b4c3f4bdf65795b85fc2f98e94feca1fb.zip |
mod_storage_sql: Improve check for old table index on PostgreSQL
The "pg_indexes" view is much simpler to inspect than "pg_class"
-rw-r--r-- | plugins/mod_storage_sql.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index bf97791c..3b20b3cc 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -854,7 +854,7 @@ local function upgrade_table(engine, params, apply_changes) -- luacheck: ignore 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 |