Description
The script encounters a TypeError in the rebuild_index function when processing index rebuilding operations.
How to reproduce
- Run the bloat analysis script on a PostgreSQL database. I ran with this command
./pg_bloat_check.py -c "host=<host> dbname=<db> user=<db_owner>" --bloat_schema=monitoring --format=jsonpretty --min_size='50mb' -N pg_toast --recovery_mode_norun --rebuild_index --debug > report.txt
- Identify indexes that require rebuilding
- Manually execute REINDEX INDEX CONCURRENTLY on one or more indexes
reindex index concurrently idx_large_table_composite; REINDEX
- Continue with the script's index rebuilding process
./pg_bloat_check.py -c "host=<host> dbname=<db> user=<db_owner>" --bloat_schema=monitoring --format=jsonpretty --min_size='50mb' -N pg_toast --recovery_mode_norun --rebuild_index --debug > report.txt
- Script fails with TypeError
`Traceback (most recent call last):
File "/Users/andrey.samsonov/utils/pg_bloat_check/./pg_bloat_check.py", line 747, in
rebuild_index(conn, result)
File "/Users/andrey.samsonov/utils/pg_bloat_check/./pg_bloat_check.py", line 513, in rebuild_index
quoted_table = """ + result[0] + ""."" + result[1] + """
~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable`
Unfortunately, i didn't come up with a solution but hope for your attention to this issue.
Description
The script encounters a TypeError in the rebuild_index function when processing index rebuilding operations.
How to reproduce
./pg_bloat_check.py -c "host=<host> dbname=<db> user=<db_owner>" --bloat_schema=monitoring --format=jsonpretty --min_size='50mb' -N pg_toast --recovery_mode_norun --rebuild_index --debug > report.txtreindex index concurrently idx_large_table_composite; REINDEX./pg_bloat_check.py -c "host=<host> dbname=<db> user=<db_owner>" --bloat_schema=monitoring --format=jsonpretty --min_size='50mb' -N pg_toast --recovery_mode_norun --rebuild_index --debug > report.txt`Traceback (most recent call last):
File "/Users/andrey.samsonov/utils/pg_bloat_check/./pg_bloat_check.py", line 747, in
rebuild_index(conn, result)
File "/Users/andrey.samsonov/utils/pg_bloat_check/./pg_bloat_check.py", line 513, in rebuild_index
quoted_table = """ + result[0] + ""."" + result[1] + """
~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable`
Unfortunately, i didn't come up with a solution but hope for your attention to this issue.