This video shows how to write both simple and complex function in PostgreSQL using PL/PGSQL.
No download links available.