After installing postgresql-9.2.1, naviserver-4.99.4d and OpenACS Head I upgraded one site from OpenACS 6.
At first the process did not work because the acs-kernel upgrade script 'upgrade-5.7.0d8-5.7.0d9.sql' failed creating the function 'get_func_definition'.
In my case the solution was simple, because the following upgrade script 'upgrade-5.8.0d1-5.8.0d2.sql' contains a new valid definition of the same function.
So, if one is upgrading to 5.8, he could safely remove the wrong function from the 'upgrade-5.7.0d8-5.7.0d9.sql' script.