From f3a1ef6de13e6ed0225527c60af94c927b83e701 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 24 Sep 2026 02:33:52 +1000 Subject: [PATCH] fix(postgres): one isUniqueViolation after merging the EDA and status lanes --- internal/infrastructure/postgres/edastore.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/internal/infrastructure/postgres/edastore.go b/internal/infrastructure/postgres/edastore.go index e6f5358a6..9c7cb2481 100644 --- a/internal/infrastructure/postgres/edastore.go +++ b/internal/infrastructure/postgres/edastore.go @@ -14,7 +14,6 @@ import ( "github.com/google/uuid" "github.com/jackc/pgx/v5" - "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" "github.com/samcharles93/archie-core/internal/domain/binding" @@ -521,18 +520,6 @@ func ledgerWrite(err error, what string) error { } } -// isUniqueViolation reports whether err is a PostgreSQL unique-index refusal, -// detected by SQLSTATE 23505 rather than by matching the driver's error text. -// A Postgres error whose message happens to say "unique" but whose SQLSTATE is -// something else must not be treated as one. -func isUniqueViolation(err error) bool { - var pgErr *pgconn.PgError - if !errors.As(err, &pgErr) { - return false - } - return pgErr.Code == "23505" -} - // --- tool calls --- // InsertToolCall appends one row to the tool_calls transcript.