Skip to main content

How to fix the categories ID sequence

Use this operational procedure only when category inserts fail because the PostgreSQL sequence is behind existing category IDs. Confirm the database and schema before changing sequence state.

  1. Connect to the intended database using the approved operational access path.
  2. Inspect the maximum categories.id and the sequence associated with that column.
  3. Advance the sequence to the current maximum using your database migration/operations process.
  4. Retry a controlled category insert and verify the generated ID is greater than existing IDs.

This repository does not prescribe a production connection command because credentials and deployment topology are environment-specific. For category scoping and duplicate behavior, see Categories API.