4 ms·
> In the end the main requirement for efficiency using it is you skill with not basic SQL/plpgSQL Another way I've heard this phrased is "It's much easier to h
by striking 7y ago
> In the end the main requirement for efficiency using it is you skill with not basic SQL/plpgSQL
Another way I've heard this phrased is "It's much easier to hire JS devs than PL/pgSQL devs."
- yen223 7y agoThere's a postgres extension called plv8 that essentially allows one to write database functions in JavaScript, instead of plpgsql.
- striking 7y agoOh, absolutely. Same with Python, Tcl, Perl... but that's not the part I'm talking about. The business logic being encoded as pgpl/* is just fine. But having to write complex triggers that wrap pgpl functions and making sure the state of the functions is as expected and all of the other wiring stuff is just not something most people are used to. I've recently seen an uptick in "Postgres-native" stuff being built, though. So maybe there's hope for the future.
- bni 7y agoYes, this is the true reason why these elegant solutions don't see so much adoption. Worse is better. Cheap JS devs to solve everything with heaps of imperative code is cheaper than elegant solutions. Even long term this is true. Tech debt with code that people can understand and modify is cheaper than tech debt with an elegant DSL that require learning and mental ability beyond if then else.