I see lots of questions regarding PL/pgSQL on the #openacs channel on
irc.openprojects.net (why aren't you there btw?).
Maybe some don't know or still think of the PostgreSQL PL/pgSQL in
its < 7.1 encarnation. Thinking of OpenACS 4, I re-wrote the PL/pgSQL
documentation for PostgreSQL 7.1 and also wrote a Oracle Porting
Guide.
Both of these documents were added to the official PostgreSQL
documentation and are there for your reading. Please take advantage
of them. It'll save you time and will help the project improve
faster. I wrote them with OpenACS 4 in mind, and it has good examples.
The one thing that I didn't have time to re-write for 7.1 was the
triggers documentation, but hopefully I'll get to work on it before
7.2.
You can find these docs in the PostgreSQL Programmer's guide.
http://www.postgresql.org/idocs/