2 ms·
PL/pgSQL is a first class language with first class semantics. As @sureglymop mentioned, you're probably going to get better performance than an interrupted or
by chrisjc 5y ago
PL/pgSQL is a first class language with first class semantics. As @sureglymop mentioned, you're probably going to get better performance than an interrupted or compiled language.
Another consideration is portability. Perhaps you're migrating to or from another database that has its own Procedural Language. You're probably going to have an easier time dealing with PL -> PL when migrating stored procedures.
There are times when it's just easier and more intuitive to glue a bunch of SQL together using a PL, than whipping up some python/js/etc...
Also keep in mind that depending on the DB, you may get a scripting language like python or js, but you can't use any third party libraries.