PostgreSQL example of self-contained stored procedures

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