Sequence exhaustion
pg_sequences_healthDetect PostgreSQL sequences nearing exhaustion: report consumed range, remaining values, cycling status, and whether a smaller serial or identity column will overflow first.
Instructions
Find sequences that are running out of numbers: how much of the usable range each one has consumed, how many values are left, and whether the column it feeds (serial or identity) is a smaller integer type than the sequence, which makes the column overflow first.
Only sequences at or above threshold_percent of their range are listed (default 50).
Sequences that cycle wrap around instead of failing and are flagged. A smallint or
integer key that is close to its limit needs an ALTER COLUMN ... TYPE bigint long
before the sequence ends.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pg_sequences_health"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| connection | No | ||
| threshold_percent | No |