As I’ve come to see, even large development projects fail to follow this advice. No good! Your code should not contain the bulk of your business logic unless you are Small-Time McGee. Aspire to be Big-Time Sledgehammer! My house getting bigger! Look at my circumstance!
By the way, this example deals with PostgreSQL and triggers.