Closed henriavelabarbe closed 4 years ago
Well, the error message itself has a typo looking for the wrong keyname. So need to fix that first so we can see what the real error message is. Can you apply this patch and run again?
diff --git a/pg_bloat_check.py b/pg_bloat_check.py
index e212b77..90c6138 100755
--- a/pg_bloat_check.py
+++ b/pg_bloat_check.py
@@ -458,15 +458,6 @@ def print_version():
def rebuild_index(conn, index_list):
-# if args.bloat_schema != None:
-# index_table = args.bloat_schema + "bloat_indexes"
-# else:
-# index_table = "bloat_indexes"
-
-# sql = "SELECT oid, schemaname, objectname, objecttype FROM " + index_table + " ORDER BY 2,3,4"
-# cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
-# cur.execute(sql)
-# result = cur.fetchall()
if index_list == []:
print("Bloat statistics table contains no indexes for conditions given.")
@@ -668,7 +659,7 @@ if __name__ == "__main__":
elif r['objecttype'] == 'index_pk':
type_label = 'p'
else:
- print("Unexpected object type encountered in stats table. Please report this bug to author with value found: " + str(r['objectttype']))
+ print("Unexpected object type encountered in stats table. Please report this bug to author with value found: " + str(r['objecttype']))
sys.exit(2)
justify_space = 100 - len(str(counter) + ". " + r['schemaname'] + "." + r['objectname'] + " (" + type_label + ") " + "(" + str(r['total_waste_percent']) + "%)" + r['total_wasted_size'] + " wasted")
Have you been able to run this again since I released v2.6.0 that fixed the typo in the error?
Will be closing this issue by the end of the month if there is no further response.
Closing issue for now. If you are still encountering this issue, please feel free to respond to it or create a new one at anytime and I will revisit it.
Hi, I encountered the following error on a postgresql 9.6.9 database.
Runing it again with debug :