Search Postgresql Archives

Re: Procedural Languages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/31/2012 10:36 PM, John Townsend wrote:
There are least 10 Procedural Languages available for PostGreSQL. The one that comes with the installation is PL/pgSQL.

Which ones do you use and why?

PL/PgSQL, and I avoid using anything else if at all possible. PL/PgSQL is the only language that's guaranteed to be available w/o installing additional runtimes, so it's nice and safe from the perspective of moving backups around, future-proofing, etc. It's not the fastest thing around for intensive computation, but it's very efficient when interacting heavily with the database.

I'd love to use PL/Java for some things, but PostgreSQL's multiprocess model doesn't play all that well with Java's multi-threading oriented design. The JVM startup overhead is a bit high and you can't share things between backends without expensive inter-process communication or other hacks. Because Pg doesn't re-use backends, there's a huge amount of JVM startup and shutdown cost.

I don't use PL/PythonU because there's no security model in Python, so only the "untrusted" version is available. It also requires an external runtime, and kind of sucks to install under Windows.

The new _javascript_ PL looks exciting and I suspect it'll gain a *lot* of traction in future. Most _javascript_ runtimes don't allow file I/O or other nasty things unless you explicitly enable it, they're fast to start, many support JIT compilation, etc etc. Given how much less modern _javascript_ sucks, I expect to see tons more PL/_javascript_ once Pg 9.2 starts seeing adoption.

--
Craig Ringer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux