David Fetter and Andreas Scherbaum also have solutions for this in reployment scripts:
http://people.planetpostgresql.org/dfetter/index.php?/archives/23-CREATE-OR-REPLACE-LANGUAGE.html http://andreas.scherbaum.la/blog/archives/346-create-language-if-not-exist.html---- Christophe Pettus xof(at)thebuild(dot)com