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?

 

 

Reply via email to