Re: Custom Constraint Violation Errors

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Custom Constraint Violation Errors
Дата
Msg-id 4EB8C1D5.7090605@ringerc.id.au
обсуждение исходный текст
Ответ на Re: Custom Constraint Violation Errors  (Richard Broersma <richard.broersma@gmail.com>)
Список pgsql-general
On 11/08/2011 07:06 AM, Richard Broersma wrote:

> I'd be more maintainable to catch these errors in your client
> application.  Here you would reword these error messages according the
> business rules of your client application.

+1

It's not hard to create:

   CONSTRAINT some_constraint_name FOREIGN KEY col REFERENCES blah(id)

... then in the app, match "some_constraint_name" and map it to a
suitable error. That's what I do and it works very well for all
constraint types, not just foreign key constraints.

--
Craig Ringer

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Behavior of negative OFFSET
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: