Task: Fix codename with sequence-based unique suffix
This page documents a task in the Party codename story. It captures the goal, current status, acceptance, and any notes or results.
Goal
Replace the advisory-lock + NOT-EXISTS approach with a sequence-based unique suffix so codenames are unique even under batch insert.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Party codename |
| Now | Completed 2026-03-12. |
| Waiting on | None. |
| Next | None. |
| Last touched | 2026-03-12 |
Acceptance
ores_utility_to_base26_fn(bigint)encodes sequence values into lowercase base-26 strings (satisfies codename regex constraints).ores_refdata_party_codename_seqsequence provides unique MVCC-independent values.ores_refdata_parties_insert_fntrigger appends the base-26 suffix to whimsical names; guarantees uniqueness per row in a batch.party_repository::write(vector)reinstated as a proper batch insert (the per-row workaround is no longer needed).
Plan
Captured during execution; cleared into the parent story on close.
Notes
The advisory lock from the previous task was ineffective for batch inserts; the sequence-based approach is correct by construction.
Result
Codenames unique under batch insert; batch insert restored.