PostgreSQL example of self-contained stored procedures

PostgreSQL example of self-contained stored procedures
PostgreSQL example of self-contained stored procedures
First, see my previous article about PostgreSQL functions at sivers.org/pg. That article gave tiny examples, but no finished working code.