Typically, end-users and webmasters will not deal with this kind of development. PL/pgSQL is the internal procedural language for creating things like functions. The most you will see a webmaster deal with is SQL for adding/editing an entry.
However, my day job requires me to learn several new skills and this week its PL/pgSQL. Our members receive statements twice a year based upon their inventory for a given season. Each season updates once a year. So, whatever you have for the Spring season for this year, will be updated the next, along with anything you added during said year. Got it? Good.
In order to automate this inventory listing, I am working on a dynamic SQL SELECT statement to account for time of year (really, the month) and current season. So, why is this difficult? Well, because I don’t know PL/pgSQL that well yet. I would have usually done this in PHP and simply edited the SQL statement variable with a new date. However, we have a large number of members and each of them can have one to hundreds of listings in their inventory. That means tens of thousands of possible items for a given season. In order to speed up the listing for any given member, we wrote functions to create a temporary table for that member’s listing. The end result is faster page loading on the member portal.

