Hi Tim,

Congratulations, again, for that great article. I already know a few things about PostGre but never really tried anything with its programming language (PL).

I wonder why you would use PL rather that a PHP script when it comes to performance and optimization. You said that a PHP recursive function was slower that a PL script, where can I find benchmarks ? PHP scripts can be greatly optimized thanks to pro products like Zend Encoder and I don't really see how a simple PL script can be faster that a compiled/encoded PHP script. Maybe there's a PL encoder too ?

However I completely share your opinion about using PL scripts to improve the application logic. No need to create PHP scripts to simulate contraints that a DBMS doesn't support (MySQL, except for InnoDB tables). It's like using a Template Engine to separate the form from the contents, or to use Style Sheets (CSS) to design a HTML page.

Thanks again,
JM