Catalog Seeding¶
pghf.seed_data()¶
The only place this framework's own catalog data — the built-in namespace, its 15 categories, all built-in checks, the seeded cadence suites (membership rebuilt authoritatively — a re-seed resets manual edits to any seeded-* suite), their default report intervals, and their default thresholds — actually gets written. Fully idempotent: safe to call again at any time to reset the built-in catalog back to what your installed version ships, for example after an extension upgrade.
Preserved across a re-seed: whether a namespace or category is active, and whether a check is retired (along with its retirement reason) — an administrator's own activation or retirement choices are never touched by this function. Not preserved: every other field — display name, backing function, rationale, threshold values, report intervals, and so on — is fully reset to whatever this call ships. Thresholds and report intervals on your own (non-built-in) checks are never touched by this function at all.
Report intervals are seeded from each built-in check's cadence-suite membership: 15/30/60/240 minutes for seeded-1m/-5m/-15m/-1h respectively, NULL (no suppression) for seeded-daily/-weekly/-on-demand — see Report Intervals for the full rule and how to override it.
Also gates a handful of extension-dependent checks (those needing pg_stat_statements, amcheck, or pg_visibility) on whether that extension is actually installed on this server, reporting and skipping registration when it's absent rather than registering a check that would only ever report itself as skipped.
Called once automatically at the end of installation (whether by CREATE EXTENSION or a plain SQL load); re-runnable by a superuser (or any role granted permission) at any time afterwards.
Parameters: none.
Returns: nothing. Only a role explicitly granted permission can call this.
That's every public function and procedure in pg_health_framework. For narrative walkthroughs and worked examples rather than bare signatures, see the User Guide, Adding Your Own Checks, and Events books.