I got it fixed by editing the dump file and reloading it again.
The part containing function definitions should be moved towards
beginning of the file. There are still some minor errors during
restore process, but I got my system working again.
I noticed that
pg_dump does not use 'CREATE VIEW'. Instead it puts into output file equivalent CREATE TABLE and rules. This may lead to problems, when the view/table name is long. I don't remember exact limitation of name length, but I noticed that four views from ecommerce module
could not be restored properly. Since I don't use ecommerce, I don't care, but for those of you interested - probably you will have to refer to /doc/sql directory and re-create these views.