fix_sequences
Reset serial/identity sequences that lag behind column maximums, fixing duplicate-key errors after dumps. Dry run by default; apply: true executes changes.
Instructions
Reset serial/identity sequences that have fallen behind MAX(column) — the duplicate-key state a dump leaves behind. Defaults to a dry run; pass apply: true to write.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "fix_sequences"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Connection name or id (exact when apply: true) | |
| apply | No | Actually run setval (default false = dry run) | |
| table | No | Only this table | |
| schema | No | Schema (default: connection schema or public) |