Fix: 23505: duplicate key value violates unique constraint on a concurrent EF Core insert
The check-then-insert in your handler is not atomic. Catch PostgresException with SqlState 23505, or collapse the whole thing into one INSERT ... ON CONFLICT statement. EnableRetryOnFailure will not help.