4 ms·
You can use prepared statements: https://www.postgresql.org/docs/current/sql-prepare.html https://www.postgresql.org/docs/current/sql-prepare.html
by manigandham 7y ago
You can use prepared statements: https://www.postgresql.org/docs/current/sql-prepare.html https://www.postgresql.org/docs/current/sql-prepare.html
- mjw1007 7y agoSometimes you can, but sometimes you want something that can be called as a function. And there's no PREPARE IF NOT EXISTS, so you either have to track yourself whether you've already done it or grub around in pg_prepared_statements.
- janpot 7y agonot powerful enough, I want programming capabilities. composing statements and branching
- megous 7y agoDO? https://www.postgresql.org/docs/10/sql-do.html https://www.postgresql.org/docs/10/sql-do.html
- cogman10 7y agoI DON'T want that. Maybe if there is a case where things are absolutely faster to do in the DB, but often times, you get better performance and scaling when you ship that stuff off to the application (it makes things easier to maintain as well). I'm currently dealing with a legacy system where some wing-nuts decided to push all the business logic into the DB. It is really REALLY hard to improve things like performance and scaling when that happens.