I am trying to upgrade a 4.6.3 instance at the moment and ran the script to do the functions.
Thank you Jun and Tilmann for doing that - now I know why I really must learn perl!
When I restore the data it was obvious that none of the views had been created and that most of these views were not truncated ones (but depended on cr_xxxx views which were). To make sure that I found them all I modified your script to do views and discovered that the regexp that you have in it is in the default greedy form - which does matter if searching for views.
So here is one possible alternative non greedy regexp for the record :
/^CREATE VIEW "([^"]*)"/
Maybe this will help someone to find other truncated views in some of the more infrequently used packages.
Richard