Hacker News new | past | comments | ask | show | jobs | submit login

> don't overuse triggers or stored plSQL procedures or similar they are hard to test and debug

I just don’t find this to be true at all, quite the opposite in fact.

It’s true that (AFAIK) there isn’t a stepping debugger for pl/pgsql, although I would love to hear that I’m wrong.

But it’s trivial to debug procedures using RAISE NOTICE commands, and you can run your tests non destructively (in a transaction that you abort) which makes setting up the state for debugging much easier.

I also personally find that I write fewer bugs in plpgsql simply because there is less abstraction (no DAOs, ORMs, caches etc) and I’m working much more closely with the actual data structures I care about. And the referential integrity checks tend to catch those I do write, early.




> although I would love to hear that I’m wrong.

You'd be wrong there: https://www.pgadmin.org/docs/pgadmin4/development/debugger.h...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: