Learning PostgreSQL's procedure language PL/pgSQL
I created a binary search tree to learn and practice PL/pgSQL. It was complicated enough to get a feel for PL/pgSQL.
I found that PL/pgSQL forced me to use database tables to store the tree nodes even for a temporary session. In Oracle's PL/SQL I would not have had to use database tables unless I wanted to permanently store the tree. PL/SQL has native collection types: Nested Tables, Associative Array (or index-by table), Varray
To run this code, just cut and pasted it directly into the psql.exe shell window.