keithf4 / pg_bloat_check

Bloat check script for PostgreSQL
Other
141 stars 36 forks source link

args.view_schema doesn't have a value #4

Closed acheccuc closed 8 years ago

acheccuc commented 8 years ago

I tried to create the bloat objects in a non-default schema without a lot of luck:

-bash-4.2$ ./pg_bloat_check.py -c "dbname=unpprpro" --create_stats_table --bloat_schema myschema 
Traceback (most recent call last):
  File "./pg_bloat_check.py", line 327, in <module>
    create_bloat_table(conn)
  File "./pg_bloat_check.py", line 77, in create_bloat_table
    create_sql += args.view_schema + "."
AttributeError: 'Namespace' object has no attribute 'view_schema'

Checking the code it seems like args.view_schema never gets a value... This is a simple printout of the parsed command line arguments:

-bash-4.2$ ./pg_bloat_check.py -c "dbname=unpprpro" --create_stats_table --bloat_schema myschema
Namespace(bloat_schema='myschema', commit_rate=5, connection='dbname=unpprpro', create_stats_table=True, debug=False, exclude_object_file=None, exclude_schema=None, format='simple', min_size=1, min_wasted_percentage=0.1, min_wasted_size=1, mode='both', norescan=False, pgstattuple_schema=None, quick=False, quiet=False, schema=None, tablename=None, version=False)
keithf4 commented 8 years ago

That's what I get for not testing all my options. Will have this fixed in next version. Thanks!

keithf4 commented 8 years ago

Released v2.1.0 with this fixed. Thanks again!