This is not an OpenACS problem but a PostgreSQL configuration issue. I had the same problem but unfortunately I don't remember exactly how I ended up solving it. However, if you search with google using that error message you'll get quite a lot of useful information. One of the texts say that the problem is "caused by trying to load a 7.1 plpgsql.so into 7.2.". It could be you need to setup LD_LIBRARY_PATH to point to PG_HOME/lib.