Babelfish returns 2601 - Cannot insert duplicate key row in object '%.*ls' with unique index '%.*ls'.

0

I'm receiving this error when I should get a 2627 for unique constraints violation. Please help.

AWS
light
posta 2 anni fa262 visualizzazioni
1 Risposta
0
Risposta accettata

With SQL Server there are 2 distinct errors for uniqueness violation, 2601 for unique index violation and 2627 for unique constraint violation. PostgreSQL don't have different error codes for unique index vs unique constraint violations, that's why, currently, in Babelfish both are mapped to SQL error 2627, as of June 30, 2022. As Babelfish is improved, correct mapping of both errors will be added. The recommended approach is to catch both errors: 2627 and 2601 so that your code will work with future versions of Babelfish.

AWS
light
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande