Skip to content

Chore/prepare pgtools to feed analyzer#13

Merged
gmartinez-dbai merged 2 commits intomainfrom
chore/prepare-pgtools-to-feed-analyzer
Jan 25, 2026
Merged

Chore/prepare pgtools to feed analyzer#13
gmartinez-dbai merged 2 commits intomainfrom
chore/prepare-pgtools-to-feed-analyzer

Conversation

@gmartinez-dbai
Copy link
Copy Markdown
Collaborator

This pull request updates the minimum supported PostgreSQL version from 10+ (and earlier) to 15+ across all scripts, documentation, and usage guidelines. It also introduces a new script for exporting all server settings. These changes ensure consistency in version requirements and leverage features available in PostgreSQL 15 and newer.

PostgreSQL Version Requirement Updates

  • Raised the minimum supported PostgreSQL version to 15+ throughout scripts, documentation, and checklists, replacing previous references to 10+ or earlier. This affects files such as CHANGELOG.md, CONTRIBUTING.md, README.md, GETTING-STARTED.md, docs/index.md, docs/maintenance.md, docs/optimization.md, and all SQL scripts in administration/, backup/, configuration/, maintenance/, and monitoring/ directories. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28]

Documentation and Checklist Consistency

  • Updated all documentation, checklists, and code comments to reflect PostgreSQL 15+ as the baseline, including compatibility notes, privileges, and usage instructions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Legacy Version Notes

  • Clarified legacy instructions for pre-15 and pre-10 PostgreSQL versions in relevant scripts and documentation, marking them as unsupported or legacy. [1] [2] [3]

New Feature

  • Added a new script configuration/export_all_settings.sql for exporting all PostgreSQL server settings in both human-readable and JSON formats, supporting PostgreSQL 15 and newer.

Minor Query Fix

  • Fixed a minor issue in monitoring/bloating.sql by replacing tablename with relname for compatibility with PostgreSQL 15+.

Copilot AI review requested due to automatic review settings January 25, 2026 04:15
@gmartinez-dbai gmartinez-dbai merged commit 82c4e2b into main Jan 25, 2026
7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request systematically updates the minimum supported PostgreSQL version from 10+ (and earlier versions like 9.x and 8.x) to PostgreSQL 15+ across the entire pgtools repository. It also introduces a new configuration export script and enhances HOT update monitoring with additional metrics.

Changes:

  • Updated PostgreSQL version requirements from 10+/9.x/8.x to 15+ in all SQL scripts, documentation files, and usage guidelines
  • Added new configuration/export_all_settings.sql script for comprehensive PostgreSQL settings export in table and JSON formats
  • Fixed column name in monitoring/bloating.sql from tablename to relname for proper pg_stat_user_tables compatibility
  • Enhanced HOT update optimization scripts to include live_tuples and dead_tuples metrics for better bloat analysis
  • Added video script templates for pgtools overview and HOT updates demonstrations

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CHANGELOG.md Documents version requirement change and new features
CONTRIBUTING.md Updates test checklist and PR template for PostgreSQL 15+
README.md Updates extended statistics documentation reference
GETTING-STARTED.md Updates privilege grant examples with legacy version notes
docs/index.md Updates prerequisites and extended statistics references
docs/maintenance.md Updates extended statistics references throughout
docs/optimization.md Updates requirements section for PostgreSQL 15+
videos/pgtools_overview_quickstart.md New video script for toolkit overview
videos/hot_updates_and_bloat_demo.md New video script for HOT updates and bloat demonstration
security/permission_audit.sql Updates version requirement to PostgreSQL 15+
performance/wait_event_analysis.sql Updates version requirement to PostgreSQL 15+
performance/resource_monitoring.sql Updates version requirement to PostgreSQL 15+
performance/query_performance_profiler.sql Updates version requirements and JIT comments to PostgreSQL 15+
optimization/missing_indexes.sql Updates version requirement to PostgreSQL 15+
optimization/hot_update_optimization_checklist_json.sql Updates version requirement and adds live/dead tuple metrics
optimization/hot_update_optimization_checklist.sql Updates version requirement and adds live/dead tuple metrics
monitoring/txid.sql Updates version requirement to PostgreSQL 15+
monitoring/replication.sql Updates version requirement to PostgreSQL 15+
monitoring/postgres_locking_blocking.sql Updates version requirement to PostgreSQL 15+
monitoring/locks.sql Updates version requirement to PostgreSQL 15+
monitoring/connection_pools.sql Updates version requirement to PostgreSQL 15+
monitoring/buffer_troubleshoot.sql Updates version requirement to PostgreSQL 15+
monitoring/bloating.sql Updates version requirement and fixes tablename→relname column reference
maintenance/walfile_in_use.sql Updates version requirement and legacy notes
maintenance/switch_pg_wal_file.sql Updates version requirement and legacy notes
maintenance/statistics_collector.sql Updates version requirement and extended statistics comments
maintenance/maintenance_scheduler.sql Updates version requirement to PostgreSQL 15+
configuration/export_all_settings.sql New script for exporting all PostgreSQL settings
configuration/configuration_analysis.sql Updates version requirement to PostgreSQL 15+
backup/backup_validation.sql Updates version requirement to PostgreSQL 15+
administration/table_ownership.sql Updates version requirement to PostgreSQL 15+
administration/partition_management.sql Updates version requirement to PostgreSQL 15+
administration/extensions.sql Updates version requirement to PostgreSQL 15+
administration/NonHypertables.sql Updates version requirement to PostgreSQL 15+

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

) AS s;

\echo ''
\echo 'Tip: For CSV use psql \"\\copy (SELECT ... FROM pg_settings ORDER BY category, name) TO \"'"'"'settings.csv'"'"' CSV HEADER\"'
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quoting in this Tip line is overly complex and may be confusing. The nested quotes and backslashes make the command difficult to read and could lead to copy-paste errors. Consider simplifying the tip or providing a clearer example.

Suggested change
\echo 'Tip: For CSV use psql \"\\copy (SELECT ... FROM pg_settings ORDER BY category, name) TO \"'"'"'settings.csv'"'"' CSV HEADER\"'
\echo Tip: For CSV use: psql "\copy (SELECT ... FROM pg_settings ORDER BY category, name) TO 'settings.csv' CSV HEADER"

Copilot uses AI. Check for mistakes.
Comment thread GETTING-STARTED.md
Comment on lines +329 to 330
# For pre-15 legacy versions, grant specific permissions:
psql -d your_database -c "GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO your_monitoring_user;"
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO your_monitoring_user; over-privileges the monitoring role by granting read access to all system catalogs, including pg_authid, which exposes password hashes and other sensitive metadata. An attacker who compromises your_monitoring_user (or its credentials) could then dump password hashes and perform offline cracking to escalate to superuser or other roles. Restrict the monitoring role to the minimum required views (for example, pg_stat_* and other specific catalog views) instead of granting blanket SELECT on the entire pg_catalog schema, and avoid granting access to pg_authid and similarly sensitive tables.

Suggested change
# For pre-15 legacy versions, grant specific permissions:
psql -d your_database -c "GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO your_monitoring_user;"
# For pre-15 legacy versions, grant SELECT only on required monitoring views:
psql -d your_database -c "GRANT SELECT ON pg_stat_activity, pg_stat_database, pg_stat_replication, pg_stat_bgwriter TO your_monitoring_user;"
# Add more pg_stat_* views here if your monitoring setup requires them.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants