Re: Custom Constraint Violation Errors

Поиск
Список
Период
Сортировка
Искать
От
Craig Ringer
Тема
Re: Custom Constraint Violation Errors
Дата
Msg-id
4EB8C1D5.7090605@ringerc.id.au
Ответ на
Список
Дерево обсуждения
Custom Contraint Violation Errors "Michael Musenbrock" <redeamer@gmx.net>
Re: Custom Contraint Violation Errors Richard Broersma <richard.broersma@gmail.com>
Re: Custom Constraint Violation Errors Michael Musenbrock <redeamer@gmx.net>
Re: Custom Constraint Violation Errors Richard Broersma <richard.broersma@gmail.com>
Re: Custom Constraint Violation Errors Craig Ringer <ringerc@ringerc.id.au>
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
Дата:
От: Craig Ringer
Дата:
Сообщение: Re:
FAQ