Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
candiddevmike
8 months ago
|
parent
|
context
|
favorite
| on:
Postgres LISTEN/NOTIFY does not scale
How do you handle trigger logic that compares old/new without having a round trip back to the application?
SoftTalker
8 months ago
[–]
Do it in a stored procedure not a trigger. Triggers have their place but a stored procedure is almost always better. Triggers can surprise you.
candiddevmike
8 months ago
|
parent
[–]
I don't follow how you would do that in a stored procedure outside of a trigger.
const_cast
8 months ago
|
root
|
parent
[–]
I think instead of performing an INSERT you call a stored proc that does the insert and some extra stuff.
shivasaxena
8 months ago
|
root
|
parent
[–]
Yes, we already have all of our business logic in postgres functions(create_order, create_partial_payment etc).
Doing the extra work in stored procedures is noticeably faster than relying on triggers.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: