2 x duplicate key value violation: which exception comes first ?

Поиск
Список
Период
Сортировка
От Marc Mamin
Тема 2 x duplicate key value violation: which exception comes first ?
Дата
Msg-id C4DAC901169B624F933534A26ED7DF310861B40D@JENMAIL01.ad.intershop.net
обсуждение исходный текст
Ответы Re: 2 x duplicate key value violation: which exception comes first ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

Hello,

I've a table with 1 primary key and 1 unique index.

I would like to handle differently the duplicate key violations depending on which constraints are affected.

(Within a plpgsql CATCH block, using SQLERRM).

It seems, that when both constraints would be violated, the exception is always about the primary key.

Can I rely on that or should I expect the exception order being random ?

Thanks,

Marc Mamin

В списке pgsql-general по дате отправления:

Предыдущее
От: François Beausoleil
Дата:
Сообщение: Allowed DML on replicas?
Следующее
От: Vincent de Phily
Дата:
Сообщение: Re: Privilege on schema 'public' not revokable