2 ms·
It's not that using PlPgSQL simplifies things, but that putting business logic in the RDBMS does simplify things. It does so by letting you use an ecosystem of
by cryptonector 7y ago
It's not that using PlPgSQL simplifies things, but that putting business logic in the RDBMS does simplify things. It does so by letting you use an ecosystem of tools you otherwise could not use. There are several tools that let you serve a DB via any number of protocols, including RESTful APIs, for example. You could even give out direct SQL access to power users and not have to teach them how to maintain referential integrity.
PlPgSQL is not a great language, and that's obviously not a reason to use it. But it's not obviously a reason to not use it, and more than that, it's no reason not to put business logic in the RDBMS. Once you decide to put business login in the RDBMS, PlPgSQL is just one of several languages you could use, and actually the most accessible one.