├── README.md ├── dba_scripts ├── README.txt ├── cache_hit_ratio.sh ├── cancel_all_queries.sh ├── check_postgresql_log.sh ├── columns_of_type_x.sh ├── connect_count.sh ├── current_locks.sh ├── current_queries.sh ├── database_sizes.sh ├── filename_tables.sh ├── flip_database_connect.sh ├── get_trans_min_cnt.sh ├── groups_users.sh ├── index_bloat.sh ├── index_comments.sh ├── logins_allow.sh ├── logins_block.sh ├── pg_backup.sh ├── pg_runtime.sh ├── pg_stat_all_indexes.sh ├── pg_stat_all_tables.sh ├── pg_vacuum_time.sh ├── remove_ctrl.sh ├── role_members.sh ├── slony_status.sh ├── table_column_stats.sh ├── table_comments.sh ├── table_dependents.sh ├── table_in_function.sh ├── table_in_trigger.sh ├── table_sizes.sh ├── tables_and_owners.sh ├── tables_filenames.sh ├── tables_with_FKs.sh ├── tables_with_column_name.sh ├── tables_with_no_public_grants.sh ├── tablespace_use.sh ├── triggers_and_constraints.sh ├── user_table_access.sh └── user_table_access_detail.sh └── queries ├── ALL_COLUMNS.sql ├── ALL_CONSTRAINTS.sql ├── ALL_TABLES.sql ├── README.txt ├── Tables_and_PKs.sql ├── Tables_with_FKs.sql ├── Tables_with_no_FK.sql ├── bad_idx.sql ├── blocked_transactions.sql ├── cache_hit_ratio.sql ├── cancel_all_queries.sql ├── check_fks.sql ├── column_name_type_difference.sql ├── columns_of_type_x.sql ├── connection_counts.sql ├── current_locks.sql ├── current_queries.sql ├── current_queries_blocked.sql ├── database_info.sql ├── database_sizes.sql ├── distinct_data_types.sql ├── enum_maint.sql ├── enums.sql ├── filenames_and_tables.sql ├── gen_create_indexes.sql ├── gen_drop_indexes.sql ├── gen_get_seq_max.sql ├── gen_revoke_all.sql ├── gen_table_compare_counts.sql ├── get_slony_schemas.sql ├── get_trans_min_cnt.sql ├── groups_users.sql ├── inactive_tables.sql ├── index_bloat.sql ├── index_bloat2.sql ├── index_comments.sql ├── index_sizes.sql ├── index_tablespaces.sql ├── make_alter_index_spc.sql ├── make_alter_table_spc.sql ├── most_active_tables.sql ├── parent_and_children.sql ├── pg_runtime.sql ├── pg_stat_all_indexes.sql ├── pg_stat_all_tables.sql ├── role_members.sql ├── rules.sql ├── sequence_cols.sql ├── show_dead_tuples.sql ├── table_access.sql ├── table_columns.sql ├── table_comments.sql ├── table_constraints.sql ├── table_dependents.sql ├── table_grants.sql ├── table_in_function.sql ├── table_in_schema.sql ├── table_in_trigger.sql ├── table_indexes.sql ├── table_row_counts.sql ├── table_sizes.sql ├── table_stats.sql ├── table_triggers.sql ├── tables_and_comments.sql ├── tables_and_filenames.sql ├── tables_and_owners.sql ├── tables_and_pkey.sql ├── tables_with_FKs.sql ├── tables_with_column_name.sql ├── tables_with_large_index_size.sql ├── tables_with_no_FK.sql ├── tables_with_no_pkey.sql ├── tables_with_no_public_grants.sql ├── tcp_settings.sql ├── triggers_and_constraints.sql ├── useless_indexes.sql ├── useless_indexes2.sql ├── user_table_access.sql ├── user_table_access_detail.sql ├── users.sql └── wasted_index_space.sql /README.md: -------------------------------------------------------------------------------- 1 | This is a set of Linux scripts and PostgreSQL 9.4 2 | queries by Melvin Davidson. They were shared on the 3 | pgsql-general mailing list on 26 May 2015. 4 | 5 | CAVEAT EMPTOR! 6 | Please DO NOT write to me asking me why I did things one 7 | way when you think it should be done another way, 8 | or way I chose specific values for a query. 9 | There are several available editors you can use to make your own changes. 10 | 11 | IOW: Do not peer into the oral cavity of an equestrian present! 12 | -------------------------------------------------------------------------------- /dba_scripts/README.txt: -------------------------------------------------------------------------------- 1 | These scripts should work on all versions of PostgreSQL up to 9.4 2 | Most have options to specify host and port. 3 | ./