best place to enfore rules

Поиск
Список
Период
Сортировка
От Rick Schumeyer
Тема best place to enfore rules
Дата
Msg-id 002801c4f9ab$bded0ed0$0200a8c0@dell8200
обсуждение исходный текст
Ответы Re: best place to enfore rules
Re: best place to enfore rules
Список pgsql-general

I’m new both to databases and postgres, so forgive me if this is a stupid question.

 

Where do people usually enforce business rules?  In the client application or in the database?

 

For example, I might have a rule “don’t allow customers to enter an order if their account

is delinquent.”  I could create rules, triggers, etc. to prevent an entry into the “order” table

given some condition in the “account” table.  Or I could put the logic on the client side.

 

I would think it would be better to do this inside the database.  I’m not familiar with how

the client would know what is happening.  I guess the client can tell if an SQL command

failed, but will the client know why it failed?

 

 

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