Skip to content

Commit b2e9928

Browse files
committed
fix: retry on possible concurrent access error
1 parent 1a5631d commit b2e9928

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

redshift/helpers.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const (
2121
pqErrorCodeInvalidSchemaName = "3F000"
2222
pqErrorCodeDeadlock = "40P01"
2323
pqErrorCodeFailedTransaction = "25P02"
24-
pqErrorCodeDuplicateSchema = "42P06"
24+
pqErrorDuplicateKeyViolation = "23505"
25+
26+
pqErrorCodeDuplicateSchema = "42P06"
2527

2628
pgErrorCodeInsufficientPrivileges = "42501"
2729
)
@@ -107,6 +109,7 @@ func isRetryablePQError(code string) bool {
107109
pqErrorCodeInvalidSchemaName: true,
108110
pqErrorCodeDeadlock: true,
109111
pqErrorCodeFailedTransaction: true,
112+
pqErrorDuplicateKeyViolation: true,
110113
}
111114

112115
_, ok := retryable[code]

0 commit comments

Comments
 (0)