I had installed PostgreSQL, Apache, and PHP on my laptop (running Ubuntu 6.10 Edgy) to aid in development. But when I was attempting to load a copy of the production database into PostgreSQL, it kept giving me errors on setting up the functions. Turns out that PostgreSQL (which I installed with the Ubuntu GUI package system, Synaptic) was expecting a file at /usr/lib/pgsql/plpgsql.so, but the real file was at /usr/lib/postgresql/8.1/lib/plpgsql.so. In fact, checking the file system, there was no directory called pgsql in /usr/lib. Apparently, there's some kind of bug in the Debian packager.
The quickest fix I determined was to run the following to create a softlink:$ sudo ln -s /usr/lib/postgresql/8.1/lib /usr/lib/pgsql
Now those functions setup without any errors.